Capitalize Sentence with replaceFirstChar method (Capitalize getting deprecated)
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
fun main(args: Array<String>) { | |
/* Capitalize Sentence | |
* with replaceFirstChar method*/ | |
val str = "kotlin is programing language" | |
val capit = str.replaceFirstChar { | |
char -> char.uppercaseChar() | |
} | |
println(capit) | |
} |
Comments
Post a Comment