[Solved] How to split string in JavaScript [closed]


var yourString="Normal content<code>Add your code here</code>Normal content<code>Add your code here</code>";

var arrResult=yourString.replace(/\<code\>/g,'#<code>').replace(/\<\/code\>/g,'</code>#').split("#");

try this.

2

solved How to split string in JavaScript [closed]