我的方法 webClient.DownloadString(URL)
将获取的字符串值转换为字符串。因此我有一个 ""result""
。那么,如何将 ""result""
转换为 "result"
?
最佳答案
使用String.Trim
:
VB.NET:
Dim str = webClient.DownloadString(URL)
str = str.Trim(""""c)
C#:
string str = webClient.DownloadString(URL);
str = str.Trim('"');
如果要删除多个前导字符和尾随字符,可以将多个字符传递给它。
关于c# - 我怎样才能展平嵌套的字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33758869/