user3105998
user3105998

Reputation: 45

Ignore " when creating string in vb.net?

I want to create a string with " in it, but they are used in defining them. So, trying to create a string with " will just end the string.

Is there a way around this?

Upvotes: 0

Views: 52

Answers (1)

Adam Zuckerman
Adam Zuckerman

Reputation: 1641

Dim Something As String

Something = "abc""def"
' Something contains abc"def

You have to escape a quote with another quote.

If you need a quote at either end of a string, use 3 quotes together:

Something = """abc"""
' Something contains "abc"

Upvotes: 3

Related Questions