是否可以使用正则表达式在JavaScript中分割任意数量的字符?
例子:
“这些是____下划线”将返回 ["These are ", " underscores"]
["These are ", " underscores"]
这是我到目前为止的内容:
"These are ____ underscores".split("_").filter(x => x);
但是,我不确定是否有更有效/更好的方法来做到这一点。
谢谢。
翻过高山走不出你
慕桂英4014372
相关分类