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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. replace not working

replace not working

Scheduled Pinned Locked Moved ASP.NET
csharphelpasp-net
4 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.
  • S Offline
    S Offline
    Sushantc
    wrote on last edited by
    #1

    dear all, i am working on an web based application using asp.net and c#.net. i am not able to use strAns.replace("'","\'") function. It is not throwing any error but not functioning properly. pls help

    Thanks and Regards, Sushanth_CP

    G L 2 Replies Last reply
    0
    • S Sushantc

      dear all, i am working on an web based application using asp.net and c#.net. i am not able to use strAns.replace("'","\'") function. It is not throwing any error but not functioning properly. pls help

      Thanks and Regards, Sushanth_CP

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Strange. That code should not compile, as \' is not a valid escape sequence. You have to use "\\'" to get a string containing a backslash followed by an apostrophe.

      --- b { font-weight: normal; }

      B 1 Reply Last reply
      0
      • G Guffa

        Strange. That code should not compile, as \' is not a valid escape sequence. You have to use "\\'" to get a string containing a backslash followed by an apostrophe.

        --- b { font-weight: normal; }

        B Offline
        B Offline
        Bulky Fellow
        wrote on last edited by
        #3

        I'm sure that's the answer. \' is not a valid escape sequence. Totally agree with Guffa. \\' is the way of escaping the slash.

        ASP - AJAX is SEXY. PERIOD.

        1 Reply Last reply
        0
        • S Sushantc

          dear all, i am working on an web based application using asp.net and c#.net. i am not able to use strAns.replace("'","\'") function. It is not throwing any error but not functioning properly. pls help

          Thanks and Regards, Sushanth_CP

          L Offline
          L Offline
          l0kke
          wrote on last edited by
          #4

          do you use it this way? strAns = strAns.Replace("'","\'"); Pilo

          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