I have a String that contain few word i need that each first letter of the word will be upper case
Example: String Name= "jean cristoff";
result: Jean Cristoff
how can i do that?
Thanks for helping!!
I have a String that contain few word i need that each first letter of the word will be upper case
Example: String Name= "jean cristoff";
result: Jean Cristoff
how can i do that?
Thanks for helping!!
Strings[] strings = name.split(" ");
StringBuilder builder = new StringBuilder();
for (String string : string) {
String str = string.substring(0,1).toUpperCase() + string.substring(1,string.length());
builder.append(str).append(" ");
}
String result = builder.toString();