如何删除双引号 [英] How to remove double quotes
问题描述
我需要最终结果是
http:// text:moretext @ numbers:morenumbers / jsonrpc?request = {jsonrpc:2.0,method:VideoLibrary。扫描}
然后用Process.Start()打开它;
但即使我操作文本应该是,当我在process.start中打开它然后双引号在它前面得到\
当我查看我的字符串时它是很好,只有当我把它移到process.start它似乎包括\
我希望有一个聪明的人可以建议我/>
我尝试了什么:
我试图更改双引号用\
我尝试改为单引号然后做一个替换(',\);
我也试过@http:// text:moretext @ numbers:morenumbers / jsonrpc?request = {jsonrpc:2.0,method :VideoLibrary.Scan}
所有这些当将它移动到process.start然后它在双引号中添加\,这使得url无法正常工作
感谢你的努力
I need the final result to be
http://text:moretext@numbers:morenumbers/jsonrpc?request={"jsonrpc":"2.0","method":"VideoLibrary.Scan"}
and then open it with Process.Start();
But even though I manipulate the text as it should be, when I open it in process.start then the double quotes gets \ in front of it
When I view my string it is fine, it is only when I move it to the process.start it seems to include the \
I hope there is a smart person who can advice me
What I have tried:
I have tried to change the double quotes with \"
I have tried change to single quotes and then do a replace("'", "\"");
I tried also with @"http://text:moretext@numbers:morenumbers/jsonrpc?request={""jsonrpc"":""2.0"",""method"":""VideoLibrary.Scan""}"
All of them when moving it to process.start then it add the \ in fron of the double quotes, which makes the url not work as intended
Thanks for your efforts
推荐答案
在我的文本字符串中替换%22,解决了问题
Replacing the " with %22 in my text string, resolved the issue
你需要什么用于URL QueryString值的是 UrlEncode [ ^ ]用于删除特殊字符,如标记。我已经为您提供了多个版本的链接 - 选择最适合您应用类型的链接。
What you need to use for URL QueryString values is UrlEncode[^] for uncoding special characters like the " mark. I've given you a link with multiple versions - pick the one that best suits your type of application.
这篇关于如何删除双引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!