【发布时间】:2019-07-18 23:03:20
【问题描述】:
我有一个字符串:
responsestring = "<?xml version="1.0" encoding="utf-8"?>
<upload><image><name></name><hash>SOmetext</hash>"
我怎样才能得到之间的值
<hash> and </hash>
?
我的尝试:
responseString.Substring(responseString.LastIndexOf("<hash>") + 6, 8); // this sort of works , but won't work in every situation.
也尝试过使用 xmlreader ,但找不到解决方案。
ty
【问题讨论】: