469,579 Members | 1,272 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

replacing quotes within a string variable

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
ti****@att.net

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #1
2 11255
"TimothyBarbour" <timbar@-NOSPAM-att.net> schrieb
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
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
* TimothyBarbour <timbar@-NOSPAM-att.net> scripsit:
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")
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by sinister | last post: by
6 posts views Thread by Cyrus D. | last post: by
11 posts views Thread by Jakanapes | last post: by
1 post views Thread by JehanNYNJ | last post: by
5 posts views Thread by Joel | last post: by
1 post views Thread by asd987 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.