I am use RegExp. This code give sş. I want to make ss. How can I do this. Thanks for answers.
import RegExp.as;
var pattern:Array = new Array();
pattern[0] = new RegExp("ş","s");
var patternReplace:Array = ["s"];
function decomposeUnicode(str:String):String
{
str = "şş"
for (var i = 0; i < pattern.length; i++)
{
str = str.replace(pattern[i], patternReplace[i]);
}
return str;
}
trace(decomposeUnicode());
All you have to do is define the global flag “g” when creating you’re RegExp. I don’t know if you really want to define dotall (indicates if . matches new line characters) but that’s what you’re doing by setting “s” in the second parameter. I’ll let it there for the example.