jQuery Remove string from string

后端 未结 5 1825
情书的邮戳
情书的邮戳 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:51

    pretty sure you just want the plain old replace function. use like this:

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

    i suppose if you want to remove the trailing comma do this instead:

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

    edit:

    here is your site specific code:

    jQuery("#post_like_list-510").text().replace(...) 
    

提交回复
热议问题