如何将带引号和双引号的文本分配给字符串. [英] how to assign text having quotes n double quotes to a string.
本文介绍了如何将带引号和双引号的文本分配给字符串.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个字符串
""[[SomeFolder] Microsoft.NET \ Framework \ start.exe""abc.dll""
我想将其分配给字符串.
我想在引号和结尾都保留两个引号(在我的字符串中是单引号和双引号),即".
i have this string
''"[SomeFolder]Microsoft.NET\Framework\start.exe" "abc.dll"''
i want to assign it to a string.
i want to keep both quotes (single and double in my string) i.e ''" in beginning and end
推荐答案
您的意思是类似
吗?
Do you mean something like
string s = "[SomeFolder]Microsoft.NET\\Framework\\start.exe\" \"abc.dll\"";
替代版本
Alternative version
string s = @"[SomeFolder]Microsoft.NET\Framework\start.exe"" ""abc.dll""";
想一想断掉:
字符串s ="\" [SomeFolder] Microsoft.NET \\ Framework \\ start.exe \"\" abc.dll \";
Think you got it just a little bit off:
string s = "\"[SomeFolder]Microsoft.NET\\Framework\\start.exe\" \"abc.dll\"";
这篇关于如何将带引号和双引号的文本分配给字符串.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文