Skip to content Skip to sidebar Skip to footer

Get Substring Between Two Characters In Javascript

After searching SO and other articles (all in vein) a few days before I asked a question about getting numbers between two characters using Javascript only. But unforunately I want

Solution 1:

Like this? It will still break with escaped \" characters.

str.match(/".*?"/g).map(function(str) {
  return str.substring(1, str.length - 1);
});

Post a Comment for "Get Substring Between Two Characters In Javascript"