我有一个网络服务,它的响应是:
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">
<contractor-management>
<request-attributes> <corp-id>abcd</corp-id></request-attributes>
</contractor-management>
</string>
我收到了上述回复,但我想删除字符串标记行。所以它应该是这样的:
<?xml version="1.0" encoding="utf-8" ?>
<contractor-management>
<request-attributes> <corp-id>abcd</corp-id></request-attributes>
</contractor-management>
由于某种原因(“-”不能用作变量名的一部分),我正在创建上面这样的:
string x;
x = "<contractor-management>";
x += "<request-attributes> ";
x += "<corp-id>abcd</corp-id> ";
x += "</request-attributes> ";
x = "</contractor-management>";