I want to replace some chars with accents in a String like this example:
str.replace('á','a');
str.replace('â','a');
str.replace('ã','a');
This will work, but I want to know if there is some simple way where I pass all the chars to be replaced and the char that will replace they.
Something like these:
replace(str,"áâã",'a');
or:
char[] chars = {'á','â','ã'};
replace(str,chars,'a');
I looked at StringUtils from Apache Lang, but not exists this way I mentioned.
You’re going to want to look at
Off the top of my head, I can’t recall Java’s regex format, so I can’t give you a format that catches those three. In my mind, it would be