/// <summary>
/// 处理json字符串,将[]{}'"字符去除
/// </summary>
/// <param name="JsonStr">需处理的字符串</param>
/// <returns>处理后的字符串</returns>
public static string DealJsonStr(string JsonStr)
{
Regex regex = new Regex(@"[\]\[\}\{""\']+");
Match match = null;
while ((match = regex.Match(JsonStr)).Success)
{
JsonStr = JsonStr.Replace(match.Value, string.Empty);
}
return JsonStr;
}
C#正则表达式判断是否含有指定字符并去除
最新推荐文章于 2024-06-11 20:36:13 发布