Example strings
one thousand only
two hundred
twenty
seven
How do I change the first character of a string in capital letter and not change
My functional approach. its capstilise first character in sentence after whitescape in whole paragraph.
For capatilising only first character of the word just remove .split(" ")
b.name.split(" ")
.filter { !it.isEmpty() }
.map { it.substring(0, 1).toUpperCase()
+it.substring(1).toLowerCase() }
.joinToString(" ")