【发布时间】:2014-04-01 11:51:20
【问题描述】:
我有一个类似
的字符串count-contribute-1
count-contribute-11
count-contribute-1111
这里我要拆分字符串,得到最后一个拆分值(即1,11,1111);
我该怎么做?
【问题讨论】:
-
不清楚 OP 到底想要什么。但被投票继续
-
虽然不是一个好的解决方案,只是补充一下,有一种方法像
var string = "count-contribute-1"; string.substring(string.lastIndexOf('-')+1, string.length)
标签: javascript