//替换字符 replace('被替换的字符','替换为的字符')
var str = 'andy'
console.log(str.replace('a','b'));
//有一个字符串 'abcoefoxyozzopp' 要求把里面的O替换为*
var str1 = 'abcoefoxyozzopp';
while(str1.indexof('o') !== -1){
str1 = str1.replace('o','*');
}
console.log(str1);
//字符串转为数组 split('分隔符')
var str2 = 'red , pink , blue';
console.log(str2.split(','));
var str3 = 'red&pink&blue';
console.log(str3.split('&'));