Split Chinese Characters

后端 未结 2 1579
一生所求
一生所求 2021-01-15 13:09

How can I split foreign characters, such as Chinese, into separate array values using JavaScript?

split() seems to work well with English, but not so m

2条回答
  •  轮回少年
    2021-01-15 13:53

    Instead of splitting on a space char (which there aren't any in the chinese string), try splitting on an empty string "", which should split each char into its own element.

提交回复
热议问题