去除多余转义字符,处理字符串中\0,\u0001等字符

用法

      string a = "\00\004\06\00\00\09\u0001\05\08\0\0\0\0\0\0\u0006";

      string s = Regex.Replace(a, @"[^(\x21-\x7E)]", "");

      Console.WriteLine(s);
      Console.ReadKey();
posted @ 2025-01-22 09:29  冰糖小袁子  阅读(136)  评论(0)    收藏  举报