newgie string help please [英] newgie string help please
问题描述
嗨我正在制作一个创建自己的桌面拍摄的aprogram和一个
想要添加一个命令行开关
所以我想要一个这样的字符串
" C:\Documents and Settings \Darren \ My Documents \ Visual Studio $
项目\shorcut\bin\Debug\shorcut.exe" / r"
我的问题是如何获得单曲引号加入我的字符串
请帮助
谢谢
Darren
hi iam righting aprogram that creates its own desktop shotcut and a
want to add a command line switch
so i want to have a string like this
"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r"
my problem is how do i get the single " quote mark into my string
please help
thanks
Darren
推荐答案
Darren-
逃避它;
string s ="你能找到\ ;额外的报价?" ;;
但是,如果你在你指明的地方给你添加一个引用字符串,你将会b / b
有不平衡的报价。你想要的是你的字符串看起来像这样;
" C:\Documents and Settings \Darren \ My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" / r
所以你要指定这样的字符串:
string s =" \" C:\Documents and设置\Darren \ My Documents \ Visual Studio <
Projects\shorcut\bin\Debug\shorcut.exe \" / r" ;;
HTH
Brian W
< darren>在消息新闻中写道:cl ******************************** @ 4ax.com ...
Darren-
By escaping it;
string s = "can you find the \" extra quote?";
But, if you add a quote to you string in the place you indicated, you will
have unbalanced quotes. What you want is for you string to look like this;
"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r
So you would assign the string like this:
string s = "\"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe\" /r";
HTH
Brian W
<darren> wrote in message news:cl********************************@4ax.com...
我喜欢正确的aprogram创建自己的桌面拍摄和
想要添加一个命令行开关
所以我想有一个这样的字符串
" C:\Documents and Settings \Darren \ My Documents \ Visual Studio > Projects\shorcut\bin\Debug\shorcut.exe" / r
我的问题是如何获得单曲引用标记到我的字符串中
请帮助
感谢
Darren
hi iam righting aprogram that creates its own desktop shotcut and a
want to add a command line switch
so i want to have a string like this
"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r"
my problem is how do i get the single " quote mark into my string
please help
thanks
Darren
你知道那条线让我无法识别的转义序列错误
string s =" \" C:\Documents and Settings \Darren \ My Documents \Visual
Studio Projects \shorcut\bin\Debug\shorcut.exe \" / r" ;;
问候
Darren
周六,2004年2月14日14:06:42 +0000,darren< ;>写道:
Hi that line gets me a unrecognized escape sequence error
string s = "\"C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe\" /r";
regards
Darren
On Sat, 14 Feb 2004 14:06:42 +0000, darren <> wrote:
嗨我正在修改程序,创建自己的桌面拍摄和
想要添加一个命令行开关
所以我想要一个像这样的字符串
C:\Documents and Settings \Darren \ My Documents \ Visual Studio > Projects\shorcut\bin\Debug \shorcut.exe" / r
我的问题是如何获得单曲引号加入我的字符串
请帮助
感谢
Darren
hi iam righting aprogram that creates its own desktop shotcut and a
want to add a command line switch
so i want to have a string like this
"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r"
my problem is how do i get the single " quote mark into my string
please help
thanks
Darren
darren写道:
darren wrote:
那行让我得到一个无法识别的转义序列错误
Hi that line gets me a unrecognized escape sequence error
阅读你真正必须的字符串上的文档。试试这个:
string s =" \" C:\\Documents and Settings \\Darren \\ My Documents \\Visual
Studio Projects \\shorcut \\bin\\Debug \\shorcut.exe \\" / r" ;;
-
gabriel
Read the docs on strings you really must. Try this:
string s = "\"C:\\Documents and Settings\\Darren\\My Documents\\Visual
Studio Projects\\shorcut\\bin\\Debug\\shorcut.exe\\" /r";
--
gabriel
这篇关于newgie string help please的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!