replace函数应用实例
replace( string1, string_to_replace, [ replacement_string ] )
replace('123123tech', '123'); would return 'tech'
两个参数,把123去掉
replace('123tech123', '123'); would return 'tech'
两个参数,把123去掉
replace('222tech', '2', '3'); would return '333tech'
三个参数,用3替换2
replace('0000123', '0'); would return '123'
两个参数 把0去掉
replace('0000123', '0', ' '); would return ' 123'
三个参数,用空格替换0
replace( string1, string_to_replace, [ replacement_string ] )
replace('123123tech', '123'); would return 'tech'
两个参数,把123去掉
replace('123tech123', '123'); would return 'tech'
两个参数,把123去掉
replace('222tech', '2', '3'); would return '333tech'
三个参数,用3替换2
replace('0000123', '0'); would return '123'
两个参数 把0去掉
replace('0000123', '0', ' '); would return ' 123'
三个参数,用空格替换0