Home >Web Front-end >JS Tutorial >JavaScript string replacement and string splitting sample code_javascript skills
JS (JavaScript) string replacement function (a bit like PHP's preg_replace)
str.replace('xxx', 'yyyy'); Replace the first
str.replace(/xxx/g, 'yyyy'); Replace all
string splitting (similar to PHP's splitting function)