【发布时间】:2020-01-14 09:21:49
【问题描述】:
我不得不根据逗号分割字符串数据。
这是excel数据:- Please find the excel data
string strCurrentLine="\"喜马拉雅盐身体磨砂膏,含 Majestic Pure 荔枝精油,全天然磨砂膏,去角质和滋润肌肤,12 盎司\",SKU_27,\"Tombow 双刷笔艺术标记,肖像,6- Pack\",SKU_27,My Shopify Store 1,Valid,NonInventory"。
Regex CSVParser = new Regex(",(?=(?:[^\"]\"[^\"]\")(?![^\"] \"))"); string[] lstColumnValues = CSVParser.Split(strCurrentLine);
I have attached the image.The problem is I used the Regex to split the string with comma but i need the ouptut just like SKU_27 because string[0] and string2 包含正反斜杠。我需要输出字符串1 并删除正反斜杠。
【问题讨论】:
-
欢迎来到 StackOverflow!请不要将文本数据附加为图像,没有人会输入它。还请告诉我们更多关于您以前解决问题的尝试,例如。您可以粘贴代码片段等。
标签: c#-4.0