【发布时间】:2012-08-01 23:54:45
【问题描述】:
可能重复:
Use RegExp to match a parenthetical number then increment it
我已经知道如何实现该解决方案,但需要编写几行代码;我想知道是否有一种简短而聪明的方法来访问整数字符串的子字符串并递增它,其中子字符串没有包含在任何标记标签中?
/*Let's say the string is*/ "<span class="ideacount">[5 ideas]</span>"
我想增加它说“[6 个想法]”。
【问题讨论】:
标签: javascript jquery substring increment