var
str =
'abcadeacf'
;
str1 = str.replace(
'a'
,
'o'
);
alert(str1);
// 打印结果: obcadeacf
str2 = str.replace(/a/g,
alert(str2);
//打印结果: obcodeocf,