Try this to remove Special Characters
public static String getOnlyStrings(String s) {
Pattern pattern = Pattern.compile("[^a-z A-Z]");
Matcher matcher = pattern.matcher(s);
String number = matcher.replaceAll("");
return number;
}
So your call should be
str = getOnlyStrings(str);
& then capitalized first letter using
str.replace(str.charAt(0),str.toUpperCase().charAt(0));
You may need to change the Pattern according to your needs, Current pattern only accepts Characters from a to z
Credits : Answer: How to remove special characters from a string?