How can I parse a CSV string with JavaScript, which contains comma in data?

前端 未结 17 918
不知归路
不知归路 2020-11-22 01:52

I have the following type of string

var string = "\'string, duppi, du\', 23, lala"

I want to split the string into an array on each

17条回答
  •  花落未央
    2020-11-22 02:08

    While reading the CSV file into a string, it contains null values in between strings, so try it with \0 line by line. It works for me.

    stringLine = stringLine.replace(/\0/g, "" );
    

提交回复
热议问题