Last active
August 29, 2015 14:24
-
-
Save Ben-G/ebd15c7c227eb296985c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
var str = "Hello, playground" | |
let greeting: String = "hello, world!" | |
let capitalizedGreeting = greeting.capitalizedString | |
let testString = "👴🙅HahaśāGœ" | |
for c in testString.characters { | |
print(c) | |
} | |
for c in testString.cStringUsingEncoding(NSUTF16StringEncoding)! { | |
print(c) | |
} | |
let oldString: NSString = testString | |
print(oldString.length, appendNewline: false) // 12 | |
print(testString.characters.count, appendNewline: false) // 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment