DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Lim Wing Hoe Guest

    Parsing strings of text to find ' and "

    Addition to the Writing SQL problem post earlier, I found out that I will
    need to do the following.

    I need to parse the string that the user entered to find single quotes ' and
    double quotes ", add backslash \ just before the single quotes and double
    quotes.

    How can I do that?
    --



    Best Regards,
    Wing Hoe
    ---------------------------------------------------------------
    Email: winghoe@hotmail.com
    ICQ: 2213281
    www: http://pwp.maxis.net.my/winghoe
    Job Seeking Status : Active
    Availability : May 2001 (after degree course finish)
    ---------------------------------------------------------------





  2. #2
    Paul Clapham Guest

    Re: Parsing strings of text to find ' and "

    I use a PreparedStatement instead of a Statement to do this. It takes care
    of all those details, and it's also faster on many databases if you do more
    than one insert.

    PC2

    Lim Wing Hoe <winghoe@hotmail.com> wrote in message
    news:3a419ae4@news.devx.com...
    > Addition to the Writing SQL problem post earlier, I found out that I will
    > need to do the following.
    >
    > I need to parse the string that the user entered to find single quotes '

    and
    > double quotes ", add backslash \ just before the single quotes and double
    > quotes.
    >
    > How can I do that?
    > --
    >
    >
    >
    > Best Regards,
    > Wing Hoe
    > ---------------------------------------------------------------
    > Email: winghoe@hotmail.com
    > ICQ: 2213281
    > www: http://pwp.maxis.net.my/winghoe
    > Job Seeking Status : Active
    > Availability : May 2001 (after degree course finish)
    > ---------------------------------------------------------------
    >
    >
    >
    >




  3. #3
    Lim Wing Hoe Guest

    Re: Parsing strings of text to find ' and "

    Thanks. It's working now.

    --



    Best Regards,
    Wing Hoe
    ---------------------------------------------------------------
    Email: winghoe@hotmail.com
    ICQ: 2213281
    www: http://pwp.maxis.net.my/winghoe
    Job Seeking Status : Active
    Availability : May 2001 (after degree course finish)
    ---------------------------------------------------------------


    "Paul Clapham" <pclapham@core-mark.com> wrote in message
    news:3a423c5a$1@news.devx.com...
    > I use a PreparedStatement instead of a Statement to do this. It takes

    care
    > of all those details, and it's also faster on many databases if you do

    more
    > than one insert.





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links