replace()普通用法
str1 = 'today is a good~ today iam happy'
"today is a good~ today iam happy"
str1.replace('today','tomorrow')
"tomorrow is a good~ today iam happy"
全局替换用法:
str1.replace(/today/g,'tomorrow')
"tomorrow is a good~ tomorrow iam happy"