Reputation: 613
Here the java script method what i used in my form to convert french to english
function checkgsm(s){
var str = s.charAt(s.length-1);
s=s.replace(/\300/gi, "A");
s=s.replace(/\301/gi, "A");
s=s.replace(/\302/gi, "A");
s=s.replace(/\303/gi, "A");
s=s.replace(/\304/gi, "A");
s=s.replace(/\352/gi, "a");
s=s.replace(/\347/gi, "C");
s=s.replace(/\307/gi, "c");
return s;
}
If i entered Ç(caps) it will be changed to C(caps).Then i entered ç the result will be cc(small)..The old caps C also replaced by small c. replace method didnt care about whether it is an uppercase or lower case.If uppercase(Ç) comes it will be changed to C.If lower(ç) came it will be c.Any other method to do exact replacement ?
Upvotes: 0
Views: 631