public String setPassword(String username) {
int passl = 8;
String s = username;
if(s.length()<passl) {
s+="*";
}
if(s.length()>passl) {
s=s.substring(0,passl);
}
return s.replaceAll( "[aeiou]", "*" );
}
I have this code. When it gets a username it replaces all vowels to * and now I need to replace first found alphabetic char to uppercase char. Like username is AdrianDe and it must return something like this *Dr**nD*