可能重複:
Replace all spaces in a string with '+'如何從javascript中的字符串中刪除以下文本?
如何在JavaScript中的 字符串中刪除,@[email protected] @[email protected]
和 ,@contacts.Assessor - [email protected] @contacts.Assessor - [email protected]
?
由於
可能重複:
Replace all spaces in a string with '+'如何從javascript中的字符串中刪除以下文本?
如何在JavaScript中的 字符串中刪除,@[email protected] @[email protected]
和 ,@contacts.Assessor - [email protected] @contacts.Assessor - [email protected]
?
由於
只需使用.replace()
string = string
.replace(',@contacts.Assessor - [email protected] @contacts.Assessor - [email protected]', '')
.replace(',@[email protected] @[email protected]', '');
考慮鏈接那些'替換'調用。 ..'x = x.replace(...)。replace(...);' –
@ŠimeVidas:好主意。完成 –
謝謝。有用。 –
'STR = str.replace(/富/克, '');'其中'foo'是要在文本刪除(你將不得不逃脫點和廣告符號) –
還有約300個其他問題的重複 - http://stackoverflow.com/search?q=javascript+string+replace –