webster Posted April 12, 2017 Share Posted April 12, 2017 Hello, I need help in using split with utf8 string like below: <!DOCTYPE html><html><body><script>var numbers;var Emoj1 = ' Link to comment Share on other sites More sharing options...
requinix Posted April 12, 2017 Share Posted April 12, 2017 Seems .split is not Unicode safe. Seems like ECMAScript says it should be... Use .match(RegExp) instead. With the /u flag it will match every Unicode character in the string. numbers = what.match(/./gu); Link to comment Share on other sites More sharing options...
webster Posted April 13, 2017 Author Share Posted April 13, 2017 Thanks requinix,it is working. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.