str.replace(‘xxx', ‘yyyy'); 替换第一个 str.replace(/xxx/g, ‘yyyy'); 替换全部
字符串分割(类似PHP的分割函数) 代码如下: var test = ‘a-b-c-d'; test.split(‘-');