Adding a " to a string

  • Thread starter Thread starter paul reed
  • Start date Start date
P

paul reed

Hello,

I want to do concatenate two strings together and insert double quotes " in
between them. How do I do that. It doesn't like:

string1 & """ & String2

Thanks
 
String1 = "ABC"
String2 = "DEF"

String1 & """" & String2 (result is ABC"DEF)

or

String1 & """""" & String2 (result is ABC""DEF)
 
Did you tried this:

Dim test1 As String = "test1"
Dim test2 As String = "test2"
Console.WriteLine("The result is: " & test1 & """" & test2)

The result is: test1"test2

Hope that helps
 
Back
Top