Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rtutus
Aged Yak Warrior
522 Posts |
Posted - 2007-02-26 : 10:07:23
|
how to add a " at the begining and the end of a string variableLet s say I have a string variable called targif the value of targ is: d:\Program Files\Common FilesI need to produce this in code:"d:\Program Files\Common Files"So I want a string variable with quotations appended to itI tried this but nio luck:string targ = "" + targ + "";Any help pls?Thanks |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2007-02-26 : 10:30:17
|
In C#, you can escape things with the \ character:string targ = "\"" + targ + "\"";Thats a pretty crucial part of C# to understand, so definitely read up on escaping strings in C# and practice it to get the hang of it and the different options that you have.- Jeffhttp://weblogs.sqlteam.com/JeffS |
|
|
rtutus
Aged Yak Warrior
522 Posts |
Posted - 2007-03-08 : 21:15:48
|
Thank you very much |
|
|
|
|
|