@@ -6,15 +6,19 @@ function str_getcsv(input, delimiter, enclosure, escape) {
6
6
// example 2: str_getcsv('"row2""cell1","row2cell2","row2cell3"', null, null, '"');
7
7
// returns 2: ['row2"cell1', 'row2cell2', 'row2cell3']
8
8
/*
9
- // These test cases allowing for missing delimters are not currently supported
10
- example 3: str_getcsv('"row2""cell1",row2cell2,row2cell3', null, null, '"');
11
- returns 3: ['row2"cell1', 'row2cell2', 'row2cell3']
12
- example 4: str_getcsv('row1cell1,"row1,cell2",row1cell3', null, null, '"');
13
- returns 4: ['row1cell1', 'row1,cell2', 'row1cell3']
14
- example 5: str_getcsv('"row2""cell1",row2cell2,"row2""""cell3"'
15
- returns 5: ['row2"cell1', 'row2cell2', 'row2""cell3']
16
- example 6: str_getcsv('row1cell1,"row1,cell2","row1"",""cell3"', null, null, '"');
17
- returns 6: ['row1cell1', 'row1,cell2', 'row1","cell3'];
9
+ // These test cases allowing for missing delimiters are not currently supported
10
+ str_getcsv('"row2""cell1",row2cell2,row2cell3', null, null, '"');
11
+ ['row2"cell1', 'row2cell2', 'row2cell3']
12
+
13
+ str_getcsv('row1cell1,"row1,cell2",row1cell3', null, null, '"');
14
+ ['row1cell1', 'row1,cell2', 'row1cell3']
15
+
16
+ str_getcsv('"row2""cell1",row2cell2,"row2""""cell3"'
17
+ ['row2"cell1', 'row2cell2', 'row2""cell3']
18
+
19
+ str_getcsv('row1cell1,"row1,cell2","row1"",""cell3"', null, null, '"');
20
+ ['row1cell1', 'row1,cell2', 'row1","cell3'];
21
+
18
22
Should also test newlines within
19
23
*/
20
24
var i , inpLen , output = [ ] ;
0 commit comments