Does anyone know how I can cut 1st char from string in jquery?
Example: If I have a line:
var test = '3265';
How can I cut only the 1st char, so that the output will be "3" instead?
Why jQuery ?? Just use plain old javascript:
var first = test.substring(0, 1)
No need jQuery, direct javascript:
var test = '3265' var first = test.slice(0,1);
Some thoughts on the differences between .substring (),. Substr () and .slice (): http://rapd.wordpress.com/2007/07/12/javascript-substr-vs-substring/
also: What is the difference between String.slice and String.substring?
Array.prototype.shift.apply(test);