correct the duplicated code
This commit is contained in:
@ -46,7 +46,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="book" data-level="2.6" data-basepath=".." data-revision="1402300340983">
|
||||
<div class="book" data-level="2.6" data-basepath=".." data-revision="1402300498179">
|
||||
<div class="book-header">
|
||||
<!-- Actions Left -->
|
||||
<a href="#" class="btn pull-left toggle-summary" aria-label="Toggle summary"><i class="fa fa-align-justify"></i></a>
|
||||
@ -587,7 +587,7 @@
|
||||
|
||||
<div class="page-inner">
|
||||
|
||||
<section class="normal" id="section-gitbook_79">
|
||||
<section class="normal" id="section-gitbook_137">
|
||||
|
||||
<h1 id="-functions-">函数(Functions)</h1>
|
||||
<p>本页包含内容:</p>
|
||||
@ -760,8 +760,8 @@
|
||||
<pre><code> join(string: "hello", toString: "world", withJoiner: "-")
|
||||
// returns "hello-world
|
||||
</code></pre><p>当这个函数被调用时,如果<code>joiner</code>的值没有被指定,函数会使用默认值(" "):</p>
|
||||
<pre><code> join(string: "hello", toString: "world", withJoiner: "-")
|
||||
// returns "hello-world
|
||||
<pre><code> join(string: "hello", toString:"world")
|
||||
// returns "hello world"
|
||||
</code></pre><h3 id="-external-names-for-parameters-with-default-values-">默认值参数的外部参数名(External Names for Parameters with Default Values)</h3>
|
||||
<p>在大多数情况下,给带默认值的参数起一个外部参数名是很有用的。这样可以保证当函数被调用且带默认值的参数被提供值时,实参的意图是明显的。</p>
|
||||
<p>为了使定义外部参数名更加简单,当你未给带默认值的参数提供外部参数名时,Swift会自动提供外部名字。此时外部参数名与局部名字是一样的,就像你已经在局部参数名前写了<code>井号(#)</code>一样。</p>
|
||||
|
||||
Reference in New Issue
Block a user