Last active
February 15, 2018 09:54
-
-
Save EmmanuelGuther/4e85bb62311aa36640486eef3f99808f to your computer and use it in GitHub Desktop.
When you want to make sure that a string starts with a capital letter and follows it lowercase
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
fun capitalizeFirstLetter(string: String?): String? = string?.substring(0, 1)?.toUpperCase() + string?.substring(1)?.toLowerCase() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment