3

「2500 - SomeValue」という文字列があります。「SomeValue」の「S」より前のすべてを削除するにはどうすればよいですか?

var x = "2500 - SomeValue";
var y = x.substring(x.lastIndexOf(" - "),
// this is where I'm stuck, I need the rest of the string starting from here. 

助けてくれてありがとう。

~ck

4

7 に答える 7

0
x.substring(x.lastIndexOf(" - "),x.length-1); //corrected
于 2009-08-20T22:51:55.890 に答える