关于as3替换字符串

//replace all
var str:String="AAABBBCCCAAA";
str=str.split("AAA").join("DDD");
//结果str为:DDDBBBCCCDDD

//replace first
var str:String="AAABBBCCCAAA";
str=str.replace("AAA","DDD");
//结果str为:DDDBBBCCCAAA
发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>