1.

Solve : Get part of a string in javascript??

Answer»

Code: [Select]var x = "$5.99 SOMETHING here";
// How would I get the first 6 letters in 'x' ?

Thanks for your time and assistance.substr() - http://www.w3schools.com/jsref/jsref_substr.asp
slice() - http://www.w3schools.com/jsref/jsref_slice_string.asp

I'd SAY substr() is what you WANT.



Discussion

No Comment Found