如何在JQuery中删除字符串的前三个字母?

例如:将cat1234转换为1234

最佳答案

无需jQuery。

"cat1234".slice(3);

或者
"cat1234".substring(3);

或者
"cat1234".substr(3);

var str="cat1234";
console.log("using slice =",str.slice(3));
console.log("using substring =",str.substring(3));
console.log("using substr =",str.substr(3));

关于javascript - 如何删除JQuery中的前3个字母?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8268052/

10-11 12:46