jQuery Remove string from string

后端 未结 5 1824
情书的邮戳
情书的邮戳 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 02:01

    Pretty sure nobody answer your question to your exact terms, you want it for dynamic text

    var newString = myString.substring( myString.indexOf( "," ) +1, myString.length );
    

    It takes a substring from the first comma, to the end

提交回复
热议问题