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
You can try the following code:
public string capitalize(str) { String[] array = str.split(" "); String newStr; for(int i = 0; i < array.length; i++) { newStr += array[i].substring(0,1).toUpperCase() + array[i].substring(1) + " "; } return newStr.trim(); }