var example:String = "This is a cool sentence.";
trace(example.replace("is","is not"));
输出结果是:
This not is a cool sentence.
replace每次只替换一个匹配的字符(第一个匹配的字符),
var example:String = "This is a cool sentence.";
trace(example.replace("is","is not"));
输出结果是:
This not is a cool sentence.
replace每次只替换一个匹配的字符(第一个匹配的字符),