By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,686 Members | 1,510 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,686 IT Pros & Developers. It's quick & easy.

How can I remove the escape character?

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.