Link to home
Start Free TrialLog in
Avatar of Micki-Weaver
Micki-Weaver

asked on

" in a string??

how do I put "'s in a string??

so
string s = @"I would like to say "HI", thanks";
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

string s = @"I would like to say ""HI"", thanks";
try this

string s = @"I would like to say \"HI\", thanks";
Avatar of Micki-Weaver
Micki-Weaver

ASKER

nope
??

string s = @"I would like to say \"HI\", thanks";
MessageBox.Show(str);  // should get what you want
??

string s = @"I would like to say \"HI\", thanks";
MessageBox.Show(str);  // should get what you want
thats what I thought but no, if you can compile that send me the exe
i got around it for now with ulgy code,
string s = "say"+(char)34+@"HI"+(char)34+@" or not";
I would still like to know if I can do it clean
ASKER CERTIFIED SOLUTION
Avatar of hongjun
hongjun
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
nice thanks