How to split the array of string in jquery -
how split array of string in jquery. e.g.:
var input='a,b,c,d,e,f,g' //i want split in in array. //check condition if input of elements > 3. //then need remove elements in array. show array ex: output= 'a,b,c'
as new jquery
please suggest me jquery functions implement this.
var output = 'a,b,c,d,e,f,g'.split(',').slice(0, 3).join();
Comments
Post a Comment