How to get text between two characters?

后端 未结 6 1134
难免孤独
难免孤独 2020-12-06 04:55

|text to get| Other text.... migh have \"|\"\'s ...

How can I get the text to get stuff from the string (and remove it)?

It should

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-06 05:14

    string = '|text to get| Other text.... migh have "|"\'s ...';
    string = string.replace(/^\|[^|]*\|/, '');
    

提交回复
热议问题