I am using split function in javascript that will split arraylist coming from java on the basis of comma. But I am facing an issue where words having comma are splitted into two separated words. How do I overcome this problem.
Example-
["Technology Science", "Maths", "Fundamental,Theory of computation"]Output using split (,) in js:-
"Technology Science", "Maths", "Fundamental","Theory of computation"
Expected:-
"Technology Science", "Maths", "Fundamental,Theory of computation"
2
Answers
You can split on
", "
, assuring that the initial"
is not escaped.That format is coincidentally compatible with JSON. Because of that, you can use: