Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using Regular Expression to convert Double-Quote

Posted on 2013-11-15
5
Medium Priority
?
395 Views
Last Modified: 2013-11-16
Can anyone provide an example of how to remove double-quotes from a string using Regular Expressions?
0
Comment
Question by:Ray Turner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 39652481
I'm not sure why you'd need a regular expression for this, but it could be:

Dim result As String = System.Text.RegularExpressions.Regex.Replace(original, """", String.Empty)

Open in new window


A simple string replace would do the equivalent:

Dim result As String = original.Replace("""", String.Empty)

Open in new window

0
 
LVL 9

Expert Comment

by:Derek Jensen
ID: 39652543
Sorry Kaufmed, I don't mean to pretend to know more than you about VB.NET, but don't you want "\"" as your regex string?
0
 

Author Comment

by:Ray Turner
ID: 39652560
Kaufmed,

Actually I wanted to know how to do the following:

Replace this
" & vbLf & "

With this
Nothing

Can this be done using regular expressions???

That's why I thought it would be nicer with regular expressions.  And it give me a chance to learn regular expressions.

Thanks
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39652606
@bigdogdman

You're confusing C# and VB.NET. In VB, you escape a quote by using another double-quote.

@rgturner

Please clarify: When you say, "" & vbLf & "", do you mean you have a string like this:

Dim someString As String = """ & vbLf & """

Open in new window


...or like this:

Dim someString As String = "someText" & _
                           vbLf & _
                           "some more text"

Open in new window

0
 

Author Closing Comment

by:Ray Turner
ID: 39654071
Thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question