更新时间:2023-02-26 08:49:16
使用常规expresion查找引号,并使用替换替换空格:
Use a regular expresion to find the quotes, and a plain Replace to replace the spaces:
str = Regex.Replace(str, @"""[^""]+""", m => m.Value.Replace(' ', '|'));
需要C#正则表达式替换字符串里的空格
需要在c#中正则表达式
需要正则表达式来替换字符串中的所有内容
C#正则表达式——中文/英文空格(全角/半角空格)处理
用 PHP 正则表达式替换字符串开头的数字、破折号、点或空格