Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visual basic string implement

Tags:

string

vba

Insert inverted comma ("") into string visual basic

Dim str As String

str = "*.doc" & "," & "*.docx"

I want the textbox show "*.doc" & "," & "*.docx"

like image 652
MuAf Avatar asked Jul 18 '26 14:07

MuAf


1 Answers

Write the string as you want it represented:

str = "*.doc" & "," & "*.docx"

double the quotes to escape them:

str = ""*.doc"" & "","" & ""*.docx""

then quote the string entire:

str = """*.doc"" & "","" & ""*.docx"""

?str
"*.doc" & "," & "*.docx"
like image 95
Alex K. Avatar answered Jul 20 '26 10:07

Alex K.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!