String lower = Name.toLowerCase(); int a = Name.indexOf(\" \",0); String first = lower.substring(0, a); String last = lower.substring(a+1); char f = first.charAt(0);
You can apply the .toUpperCase() directly on String variables or as an attribute to text fields. Ex: -
String str; TextView txt; str.toUpperCase();// will change it to all upper case OR txt.append(str.toUpperCase()); txt.setText(str.toUpperCase());