I have a TextView. I\'m trying to capitalize the first letter in every word.
Here\'s the TextView:
In kotlin gives
private val replacementTransformationMethod: ReplacementTransformationMethod =
object : ReplacementTransformationMethod() {
override fun getOriginal(): CharArray {
return charArrayOf(
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z'
)
}
override fun getReplacement(): CharArray {
return charArrayOf(
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z'
)
}
}
then in the block override fun onActivityCreated(savedInstanceState: Bundle?)
set
this.textUserCode.transformationMethod = replacementTransformationMethod