469,279 Members | 2,200 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,279 developers. It's quick & easy.

How can I remove the escape character?

string str ="\"C:\Program Files\Internet Explorer\iexplore.exe\" -nohome"
How can I remove charcter to
string str = ="C:\Program Files\Internet Explorer\iexplore.exe -nohome"

Nov 16 '05 #1
7 22054
You could do something like str.Replace("\"","")

Lowell

Steve wrote:
string str ="\"C:\Program Files\Internet Explorer\iexplore.exe\" -nohome"
How can I remove charcter to
string str = ="C:\Program Files\Internet Explorer\iexplore.exe -nohome"

Nov 16 '05 #2
On Tue, 14 Dec 2004 16:01:02 -0800, Steve wrote:
string str ="\"C:\Program Files\Internet Explorer\iexplore.exe\" -nohome"
How can I remove charcter to
string str = ="C:\Program Files\Internet Explorer\iexplore.exe -nohome"


str = str.Replace("\"", string.Empty);
--
Tom Porterfield
Nov 16 '05 #3
Steve wrote:
string str ="\"C:\Program Files\Internet Explorer\iexplore.exe\" -nohome"
How can I remove charcter to
string str = ="C:\Program Files\Internet Explorer\iexplore.exe -nohome"

I'm not entirely sure of what you are asking here, since in both
examples the escape character exists. If you mean how can you make the
string so that it "ignores" the escape character, you can define it like so:

string str = @"C:\Program Files\Internet Explorer\iexplore.exe -nohome";

The @ symbol forces the creation of a "literal string", in which escape
characters are not interpreted as such.

HTH...

Chris
Nov 16 '05 #4
str = str.Replace("\"", string.Empty); fixed my problem, thanks a lot.
I am interesting your solution "@", for I read document also mentioned @ can
remove the escape character.

this is my code
RegistryKey readiexplorer1 =
Registry.ClassesRoot.OpenSubKey(iexplorer_registry , true);
String default_iexplorer = (String)readiexplorer1.GetValue("");
string launch_iexplorer_path = default_iexplorer +
default_command_path;
RegistryKey readiexplorer2 =
Registry.ClassesRoot.OpenSubKey(launch_iexplorer_p ath, true);
string launch_iexplorer = (String)readiexplorer2.GetValue("");
I got launch_iexplorer ="\"C:\Program Files\Internet Explorer\iexplore.exe\"
-nohome"

How can I remove the escpe character based on @?
"Chris Hyde" wrote:
Steve wrote:
string str ="\"C:\Program Files\Internet Explorer\iexplore.exe\" -nohome"
How can I remove charcter to
string str = ="C:\Program Files\Internet Explorer\iexplore.exe -nohome"

I'm not entirely sure of what you are asking here, since in both
examples the escape character exists. If you mean how can you make the
string so that it "ignores" the escape character, you can define it like so:

string str = @"C:\Program Files\Internet Explorer\iexplore.exe -nohome";

The @ symbol forces the creation of a "literal string", in which escape
characters are not interpreted as such.

HTH...

Chris

Nov 16 '05 #5
Steve wrote:
str = str.Replace("\"", string.Empty); fixed my problem, thanks a lot.
I am interesting your solution "@", for I read document also mentioned @ can
remove the escape character.

this is my code
RegistryKey readiexplorer1 =
Registry.ClassesRoot.OpenSubKey(iexplorer_registry , true);
String default_iexplorer = (String)readiexplorer1.GetValue("");
string launch_iexplorer_path = default_iexplorer +
default_command_path;
RegistryKey readiexplorer2 =
Registry.ClassesRoot.OpenSubKey(launch_iexplorer_p ath, true);
string launch_iexplorer = (String)readiexplorer2.GetValue("");
I got launch_iexplorer ="\"C:\Program Files\Internet Explorer\iexplore.exe\"
-nohome"

How can I remove the escpe character based on @?

Instead of casting to a "String", have you tried casting to a "string"?

Chris
Nov 16 '05 #6
It begs the question why you'd want to, surely the first expression is what
you'd want, i.e. with the double quotes in?
"Steve" wrote:
string str ="\"C:\Program Files\Internet Explorer\iexplore.exe\" -nohome"
How can I remove charcter to
string str = ="C:\Program Files\Internet Explorer\iexplore.exe -nohome"

Nov 16 '05 #7
No.
Without double quote in, for I will split the string with .exe this will
cause \" in another dimension.

"Bonj" wrote:
It begs the question why you'd want to, surely the first expression is what
you'd want, i.e. with the double quotes in?
"Steve" wrote:
string str ="\"C:\Program Files\Internet Explorer\iexplore.exe\" -nohome"
How can I remove charcter to
string str = ="C:\Program Files\Internet Explorer\iexplore.exe -nohome"

Nov 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by newsgroupie | last post: by
6 posts views Thread by HK guy | last post: by
15 posts views Thread by pkaeowic | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.