我想要匹配一个数字,并用那么多空格替换它。这可以在少于9行的代码中完成吗?
示例
"asnthsnth4nts4h3n" --> "asnthsnth nts h n"发布于 2010-05-28 07:33:17
试试这个:
"asnthsnth4nts4h3n".replace(/\d+/g, function($0) { return Array(parseInt($0, 10)+1).join(" "); })https://stackoverflow.com/questions/2925727
复制相似问题