我正在尝试\'
从字符串中删除
string temp = "[['90\'','','Delay in match Cédric Kanté (Sochaux) because of an injury.','away']]";
temp = Regex.Replace(temp, @"\\'", ""); >> still have ' mark [['90'','','...']
我尝试了很多方法,但都失败了。
谢谢
你应该能够做到:.Replace(temp, @"\\", "");
它采用json serilaizers可以解析的形式。不需要正则表达式。
string temp = @"[['90\'','','Delay in match Cédric Kanté (Sochaux) because of an injury.','away']]";
var js = new JavaScriptSerializer();
List<List<string>> listOfList = js.Deserialize<List<List<string>>>(temp);
foreach (var item in listOfList[0])
Console.WriteLine(item);