how to split multiple characters using javascript?

by Ramshan 2015-01-23 18:51:46

you can split any character from the string using split() in javascript as,
str.split("sdf") - this will return the result as array

incase if you want to split multiple characters in a single query, then use regular expression concept,
var splitRes = response.split(/[:}"]+/);
this will split the characters ':','}' and '"' from the response and returns the result in array.
 
1120
like
0
dislike
0
mail
flag

You must LOGIN to add comments