使用@但仍然是错误:
有谁知道为什么这一行:
String[] values = Regex.Split(line, @",(?! [\w\d\.\[\]\(\)\#\*\-_])(?=([^\"]*\"[^\"]*\")*[^\"]*$)");
错误CS1002; 预期的InsertLogtoDatabase D:\ MyProjects \ InsertLogWindowsApp \ WindowsFormsApplication1 \ LogOrderi2trade.cs 119
严重级代码描述项目文件行错误CS1003语法错误, ',' 预期的InsertLogtoDatabase D:\ MyProjects \ InsertLogWindowsApp \ WindowsFormsApplication1 \ LogOrderi2trade.cs 119
答案 0 :(得分:6)
如果您想将"
与逐字字符串文字一起使用,则需要将其加倍,如""
String[] values = Regex.Split(line, @",(?! [\w\d.[]()#*-_])(?=([^\""]\""[^\""]\"")[^\""]$)");
来自C#规范$2.4.4.5 String literals:
报价转义序列:
""