Splitting in string in JavaScript

前端 未结 3 1391
忘掉有多难
忘掉有多难 2021-01-25 06:50

How to split a string in JavaScript with the \",\" as seperator?

3条回答
  •  醉话见心
    2021-01-25 07:16

    Use split to split your string:

    "foo,bar,baz".split(",")  // returns ["foo","bar","baz"]
    

提交回复
热议问题