public static String decodeString(String strData)
        {
            strData = replaceString(strData, "<", "&lt;"); return strData;
        }

 public static String replaceString(String strData, String regex, String replacement) { if (strData == null) { return null; } int index; index = strData.IndexOf(regex); String strNew = ""; if (index >= 0) { while (index >= 0) { strNew += strData.Substring(0, index) + replacement; strData = strData.Substring(index + regex.Length); index = strData.IndexOf(regex); } strNew += strData; return strNew; } return strData; }

  把尖括号转义,传过去的时候就是字符串了,但是不会影响接收方对xml的操作。

相关文章:

  • 2021-06-19
  • 2021-11-25
  • 2022-02-23
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-31
  • 2021-05-25
  • 2022-03-05
  • 2021-06-23
  • 2021-07-04
相关资源
相似解决方案