Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
164
rated 0 times [  167] [ 3]  / answers: 1 / hits: 85027  / 13 Years ago, fri, november 25, 2011, 12:00:00

How can I remove the first three letters of a string in JQuery?



For example: Turn cat1234 to 1234


More From » jquery

 Answers
186

No jQuery needed.



cat1234.slice(3);


or



cat1234.substring(3);


or



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));




[#88911] Wednesday, November 23, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sidneyh

Total Points: 118
Total Questions: 108
Total Answers: 105

Location: Mali
Member since Fri, Jun 18, 2021
3 Years ago
sidneyh questions
Tue, Jun 7, 22, 00:00, 2 Years ago
Wed, Apr 13, 22, 00:00, 2 Years ago
Wed, Aug 12, 20, 00:00, 4 Years ago
Wed, Jun 3, 20, 00:00, 4 Years ago
Fri, Apr 24, 20, 00:00, 4 Years ago
;