Double quote variables
-
Hi, Instead of a R,D want to change the format to "R", "D". I have tried embedding some formatting like string = """ & "R" & """ & "," & _ """ & "D" & """ Thanks for your time.
You don't need to create the quotes seperately, you can build it all as one string. This is language specific question that has nothing to do with ASP.NET, it looks like this is VB, which means I don't know exactly how to do it, in C# you use \"
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hi, Instead of a R,D want to change the format to "R", "D". I have tried embedding some formatting like string = """ & "R" & """ & "," & _ """ & "D" & """ Thanks for your time.
To add to what Chrstian said:
string = """R"",""D"""
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
To add to what Chrstian said:
string = """R"",""D"""
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Another option worth a look at, would be to use string.format. It might not be especially usefull for two charectors, but works well with medium to larger strings. VB Dim s As String = String.Format("{0}{1}{0}, {0}{2}{0}", """", "R", "D") C# string s = string.Format("{0}{1}{0}, {0}{2}{0}", "\"", "R", "D"); This first argument is the format of the string (between first set of quotes), then just supply the parameters that you made place holders for (in the example 3). *Edit (Added C# example - sorry I work with VB more than C#) -- modified at 21:44 Monday 23rd July, 2007
-
Another option worth a look at, would be to use string.format. It might not be especially usefull for two charectors, but works well with medium to larger strings. VB Dim s As String = String.Format("{0}{1}{0}, {0}{2}{0}", """", "R", "D") C# string s = string.Format("{0}{1}{0}, {0}{2}{0}", "\"", "R", "D"); This first argument is the format of the string (between first set of quotes), then just supply the parameters that you made place holders for (in the example 3). *Edit (Added C# example - sorry I work with VB more than C#) -- modified at 21:44 Monday 23rd July, 2007
I was going to do a String.Format example, I guess you beat me to it :)
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
-
I was going to do a String.Format example, I guess you beat me to it :)
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
-
That'll work just fine, as well.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer