jQuery Remove string from string

后端 未结 5 1786
情书的邮戳
情书的邮戳 2021-01-31 00:59

I am trying to remove a string from a string in jQuery.

Here is the string:

username1, username2 and username3 like this post.

I would

5条回答
  •  滥情空心
    2021-01-31 01:53

    To add on nathan gonzalez answer, please note you need to assign the replaced object after calling replace function since it is not a mutator function:

    myString = myString.replace('username1','');
    

提交回复
热议问题