I am trying to break two Persian characters using javascript string markup, but it does not split properly.
var test = '"حسن روحانی"،"حسن+روحانی"';
var tmpkeywords = test.split(',');
console.log(tmpkeywords);
the separation result should be as follows: ["حسن روحانی" "," حسن + روحانی ""]
but instead it goes like ["حسن روحانی", "حسن + روحانی" ↵ "]. It works well in English characters or numbers.
My fiddle: https://jsfiddle.net/tueo3sfa/1/
source
share