我需要从字符串中删除(1.)序列号(1.这是文本) 我如何从字符串中删除序列号并获得给定的输出。
var str = '1. This is dummy text(1.1).';
Output:
This is dummy text(1.1).
最佳答案
您可以使用正则表达式替换
str.replace(/^\d+\.\s+/, '')
这将取代:
^ // from the beginning of the string
\d+ // one or multiple digits
\. // followed by literal dot
\s+ // followed by one or multiple whitespace characters
关于javascript - 我需要从字符串中删除序列号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51966851/