我如何转换它:
, ...Name: John, LastName: Smith, Gender: Male, ...
到
, ...Name: John, Gender: Male, ...
注意我将“LastName:XXXXX”替换为“”(空链)
我试过
'Remove LastName...
pattern = " LastName.*,"
replacement = ","
msAccessQuery = Regex.Replace(string, pattern, replacement)
提前致谢。
答案 0 :(得分:1)
模式将是:
\s*LastName:[^,]*,