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);
Since you know the chars are lower case, you can subtract the according ASCII value to make them uppercase:
char a = 'a'; a -= 32; System.out.println("a is " + a); //a is A
Here is an ASCII table for reference