replacing quotes within a string variable

  • Thread starter Thread starter TimothyBarbour
  • Start date Start date
T

TimothyBarbour

I am a newbie to VB.NET (and VB in general).

I'd like to replace quote marks with the string.

For example, I have a string that is "3dmesh 45 45" including the quotes.

I'd like to remove the quotes and end up with the string equal to (literally) 3dmesh 45 45

I'm using LineofText = Replace(LineofText, "3dmesh 45 45", 3dmesh 45 45)

Obviously, this doesn't work. Is there a way to remove quote marks in strings using the replace function? Are there any other ways to accomplish this?

Thanks.

Tim Barbour
(e-mail address removed)
 
TimothyBarbour said:
I'd like to replace quote marks with the string.

For example, I have a string that is "3dmesh 45 45" including the
quotes.

I'd like to remove the quotes and end up with the string equal to
(literally) 3dmesh 45 45

I'm using LineofText = Replace(LineofText, "3dmesh 45 45",
3dmesh 45 45)

Obviously, this doesn't work. Is there a way to remove quote marks
in strings using the replace function? Are there any other ways to
accomplish this?

Dim s As String = """3dmesh 45 45 """ '-> "3dmesh 45 45"

s = s.Replace("""", "") 'replace
 
* TimothyBarbour said:
I am a newbie to VB.NET (and VB in general).

I'd like to replace quote marks with the string.

For example, I have a string that is "3dmesh 45 45" including the quotes.

I'd like to remove the quotes and end up with the string equal to (literally) 3dmesh 45 45

I'm using LineofText = Replace(LineofText, "3dmesh 45 45", 3dmesh 45 45)

\\\
.... = Replace(LineOfText, """2dmesh 45 45""", "3dmesh 45 45")
///
 
Back
Top