Putting a single double-quote into a String in VB.NET

I am trying to refer to a single double-quote, not a pair of double-quotes, within a String in VB.NET, as in:

str = str.Replace("L", "A"), except with the 'L' being a ' " '.

Is such a thing possible?
StovetopAsked:
Who is Participating?
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
you can do it at least using 2 different ways:
str = str.Replace("''", "A")  'placing 2 (between 2) means 1
str = str.Replace(Convert.ToChar(34), "A")  'may be clearer
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Try this way:

Dim str As String = """Latitude and Longitude"
str = str.Replace("""L", """X").Replace("L", "A").Replace("""X", """L")
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.