Hi,
I'm looking for a simple way to achieve character substitutions. I need to convert french accents to normal characters. Example: é to e.
So I was wondering if there's a cleaner way to do it.
Code:
$string = "résumÉ ôter lake";
for ($string) {
s/-/ /g;
s/ //g;
s/á/a/g;
s/Á/A/g;
s/à/a/g;
s/À/A/g;
s/â/a/g;
s/Â/A/g;
s/é/e/g;
s/É/E/g;
s/è/e/g;
s/È/E/g;
s/ê/e/g;
s/Ê/E/g;
s/ç/c/g;
s/Ç/C/g;
s/ô/o/g;
s/Ô/O/g;
tr/a-z/A-Z/;
}
print "Should be: RESUMEOTERLAKE \n";
print "$string \n";
Thank you in advance