Skip to content

Instantly share code, notes, and snippets.

@bittz
Created August 22, 2016 14:06
Show Gist options
  • Save bittz/1181b95e2ab46834164ce0c409f20d9f to your computer and use it in GitHub Desktop.
Save bittz/1181b95e2ab46834164ce0c409f20d9f to your computer and use it in GitHub Desktop.
String with the first letter written uppercase.
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