0

How can I split the string to multiple substrings?

String = "5260,GOODS,4,10,TISSUE,,84,\"1,008\",24,24,,,78,84,24";

I was spliting the string to string[] by using comma separator ","

But One value contains comma - \"1,008\"

Is there any way to get the string as

Expected Output -

"5260,GOODS,4,10,TISSUE,,84,1008,24,24,,,78,84,24";
CodeCool
  • 193
  • 2
  • 12

1 Answers1

0

You have to "normalize" your text first by:

option 1: convverting all false positives in other format that skip the split.. i.e. you need to change (maybe with regex) the value 1,008 to something like 1.008

option 2: changing all the "," everyhere for another char(example ":") not present in the string but keeping the value 1,008 and split to ":"

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97