Created
August 22, 2016 14:06
-
-
Save bittz/1181b95e2ab46834164ce0c409f20d9f to your computer and use it in GitHub Desktop.
String with the first letter written uppercase.
This file contains hidden or 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
import Foundation | |
extension String { | |
var titleizedString: String { | |
return String(characters.prefix(1)).uppercaseString + String(characters.dropFirst()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment