From 4f456effa8cccb739725a4b0c0a783cebec3291a Mon Sep 17 00:00:00 2001 From: Xwoder Date: Sat, 23 May 2015 16:35:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=83=A8=E5=88=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/chapter2/06_Functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/chapter2/06_Functions.md b/source/chapter2/06_Functions.md index 6cea6bbc..50e6aa59 100755 --- a/source/chapter2/06_Functions.md +++ b/source/chapter2/06_Functions.md @@ -347,8 +347,8 @@ arithmeticMean(3, 8, 19) 通过在参数名前加关键字 `var` 来定义变量参数: ```swift -func alignRight(var string: String, count: Int, pad: Character) -> String { - let amountToPad = count - count(string) +func alignRight(var string: String, totalLength: Int, pad: Character) -> String { + let amountToPad = totalLength - count(string) if amountToPad < 1 { return string }