JS (JavaScript) string replacement function (a bit like PHP's preg_replace)
str.replace('xxx', 'yyyy'); replace the first one
str.replace(/xxx/g, 'yyyy'); Replace all
String splitting (similar to PHP’s split function)
Copy the code code as follows:
var test = 'abc-d';
test.split('-');