Browse Source

Merge pull request #72 from hallzy/add_join_to_docs

Added the list join method to the docs
Marco Bambini 8 years ago
parent
commit
bc55b0e553
1 changed files with 8 additions and 0 deletions
  1. 8 0
      docs/lists.html

+ 8 - 0
docs/lists.html

@@ -125,6 +125,14 @@
 	var v1 = list.pop();	// pop 100
 	var v1 = list.pop();	// pop 100
 	var v2 = list.pop();	// pop 50
 	var v2 = list.pop();	// pop 50
 			</code></pre>
 			</code></pre>
+
+			<h4 class="section-h4">List Joins</h4>
+			<p>The List class implements the join method as a convenient way to
+			interpret a list as a string:</p> 
+			<pre><code class="swift">
+	var list = [1,2,3,4,5];
+	list.join(" + "); // Becomes: "1 + 2 + 3 + 4 + 5"
+			</code></pre>
        	</div> <!-- /row -->
        	</div> <!-- /row -->
        </div> <!-- /main-content -->
        </div> <!-- /main-content -->
      </div> <!-- /container -->
      </div> <!-- /container -->