Created
February 12, 2018 15:21
-
-
Save StanislavK/e4069d6d2e0c6df53bdd7351b7c42067 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
extension String { | |
var first: String { | |
return String(characters.prefix(1)) | |
} | |
var last: String { | |
return String(characters.suffix(1)) | |
} | |
var uppercaseFirst: String { | |
return first.uppercased() + String(characters.dropFirst()) | |
} | |
var lowercaseFirst: String { | |
return first.lowercased() + String(characters.dropFirst()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment