Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. string Replace in vb.net

string Replace in vb.net

Scheduled Pinned Locked Moved Visual Basic
csharpcomhelp
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_3259094
    wrote on last edited by
    #1

    hello all i have to replace some string search text is - <a href="/ replace text is - <a href="http://www.mysite.com/ and i am using below str = Replace(str, "<a href="/","<a href="http://www.mysite.com/") but i am unable to use escape sequence . please help some

    Rajeev Kr. Sharma VRI Software Pvt.Ltd. New Delhi India HumOnline.com Stay Connected

    C D I 3 Replies Last reply
    0
    • M Member_3259094

      hello all i have to replace some string search text is - <a href="/ replace text is - <a href="http://www.mysite.com/ and i am using below str = Replace(str, "<a href="/","<a href="http://www.mysite.com/") but i am unable to use escape sequence . please help some

      Rajeev Kr. Sharma VRI Software Pvt.Ltd. New Delhi India HumOnline.com Stay Connected

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      AS you didn't tell us the error, I have to guess and assume it's because you have a " in your string, and need to use \" instead.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      M 1 Reply Last reply
      0
      • C Christian Graus

        AS you didn't tell us the error, I have to guess and assume it's because you have a " in your string, and need to use \" instead.

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        M Offline
        M Offline
        Member_3259094
        wrote on last edited by
        #3

        please type my code in you application then you will get my problem. actualy " comes im my string so it creating problem in string building

        Rajeev Kr. Sharma VRI Software Pvt.Ltd. New Delhi India HumOnline.com Stay Connected

        1 Reply Last reply
        0
        • M Member_3259094

          hello all i have to replace some string search text is - <a href="/ replace text is - <a href="http://www.mysite.com/ and i am using below str = Replace(str, "<a href="/","<a href="http://www.mysite.com/") but i am unable to use escape sequence . please help some

          Rajeev Kr. Sharma VRI Software Pvt.Ltd. New Delhi India HumOnline.com Stay Connected

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          VB doesn't understand C-style escapes. Additionally, you escaped the string delimiters, not the quotes inside the string. Double quotes must be paired up to be escaped in VB, so your statement would look like:

          str = Replace(str, "

          [A guide to posting questions on CodeProject](http://www.codeproject.com/scrapbook/ForumGuidelines.asp)\[[^](http://www.codeproject.com/scrapbook/ForumGuidelines.asp "New Window")\]
          

          Dave Kreskowiak
          Microsoft MVP
          Visual Developer - Visual Basic
               2006, 2007, 2008

          1 Reply Last reply
          0
          • M Member_3259094

            hello all i have to replace some string search text is - <a href="/ replace text is - <a href="http://www.mysite.com/ and i am using below str = Replace(str, "<a href="/","<a href="http://www.mysite.com/") but i am unable to use escape sequence . please help some

            Rajeev Kr. Sharma VRI Software Pvt.Ltd. New Delhi India HumOnline.com Stay Connected

            I Offline
            I Offline
            Icharus
            wrote on last edited by
            #5

            Try using double quoutes like so: str = Replace(str,"

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups