<?xml version="1.0" encoding="UTF-8"?>
<ErrorInfo><Code>1</Code><Content>test</Content></ErrorInfo>
结果如上,
xml头和内容之间有特殊字符
不知道怎么去掉啊?
生成这样的结果:
<?xml version="1.0" encoding="UTF-8"?><ErrorInfo><Code>1</Code><Content>test</Content></ErrorInfo>
<ErrorInfo><Code>1</Code><Content>test</Content></ErrorInfo>
结果如上,
xml头和内容之间有特殊字符
不知道怎么去掉啊?
生成这样的结果:
<?xml version="1.0" encoding="UTF-8"?><ErrorInfo><Code>1</Code><Content>test</Content></ErrorInfo>
取到String xml= 上面的string
xml.replaceAll("\r","\n").replaceAll("\n\n","\n").replaceAll("\n"," ")