Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enclose values in double quotes in VB.net

Tags:

vb.net

I have this string in vb.net. I would appreciate if you can let me know how I can enclose the values in double quotes

dim str as string=""
str.Append("EmpID=" & empNo & " DeptID=" & deptID & "")

I want the value of string to be EmiID="10" DeptID="20"

like image 237
acadia Avatar asked Dec 12 '22 23:12

acadia


2 Answers

Use double double quotes to get a single double quote in the string

str.Append("EmpID=""" & empNo & """ DeptID=""" & deptID & """")
like image 145
JaredPar Avatar answered Jan 11 '23 15:01

JaredPar


ControlChars.Quote is nice to use :)

dim metatransferString as string = ""

like image 33
Justin Avatar answered Jan 11 '23 15:01

Justin