【发布时间】:2020-01-03 06:38:17
【问题描述】:
这是我的字符串,我在拆分为字符串数组时遇到问题,键的逗号分隔值
{ Yr = 2019, Mth = DECEMBER , SeqN = 0, UComment = tet,tet1, OComment = test,test1, FWkMth = WK, FSafety = Y, FCustConsign = Y, FNCNRPull = 0, FNCNRPush = 0, CreatedTime = 2020-01-03 06:16:53 }
当我尝试使用 string.Split(',') 时,我得到 "Ucomment = tet","tet1" 作为单独的数组。 但是当用逗号分隔时我需要拆分字符串[]
UComment = tet,tet1 OComment = test,test1
我尝试过使用正则表达式 ,(?=([^\"]\"[^\"]\")[^\"]$) " 但它没有用。
【问题讨论】:
-
您的预期输出在这里是什么样的?
-
@tim-biegeleisen,它是 sring 数组,它会像 "Yr = 2019", "Mth = DECEMBER", "SeqN = 0", "UComment = tet,tet1"
标签: strsplit