Parsing strings of text to find ' and "


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Parsing strings of text to find ' and "

  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.





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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center