diff --git a/3. Strings and Characters.playground/section-1.swift b/3. Strings and Characters.playground/section-1.swift index e78b818..b6730a7 100644 --- a/3. Strings and Characters.playground/section-1.swift +++ b/3. Strings and Characters.playground/section-1.swift @@ -54,17 +54,17 @@ for character in originalString var notAString: Character = "t" // There is no length or count member of string, you have to use the global function, -// countElements() +// count() // // This is much like calling strlen in which it iterates over the Unicode string and counts // characters. Note that Unicode chars are different lenghts, so this is a non-trivial process. // -// “Note also that the character count returned by countElements is not always the same as the +// “Note also that the character count returned by count() is not always the same as the // length property of an NSString that contains the same characters. The length of an NSString is // based on the number of 16-bit code units within the string’s UTF-16 representation and not the // number of Unicode characters within the string. To reflect this fact, the length property from // NSString is called utf16count when it is accessed on a Swift String value.” -countElements(originalString) +count(originalString) // Strings can be concatenated with strings and characters var helloworld = "hello, " + "world"