Is there a way to split foreign characters like Chinese into separate array values using JavaScript?
While the split()
function works well with English, it doesn't seem to handle Chinese characters properly. Take a look at the results from two strings below:
a) Hello There
b) 你好吗
splitString = text.split(" ");
RESULT: ["hello", "there"]
RESULT: ["你好吗"]