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. C#
  4. remove escape sequence [modified]

remove escape sequence [modified]

Scheduled Pinned Locked Moved C#
15 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.
  • L Offline
    L Offline
    LiYS
    wrote on last edited by
    #1

    Hi all, How could I transform

    \"C:\\Documents and Settings\\Administrator\\Local Settings\\Temp\\image0.jpg\"

    to

    "C:\Documents and Settings\Administrator\Local Settings\Temp\image0.jpg"

    P.S This is a string inside of tag. The \\ in file path made it failed to locate the .jpg file. Thanks,


    modified on Wednesday, February 25, 2009 12:12 AM

    L X R 3 Replies Last reply
    0
    • L LiYS

      Hi all, How could I transform

      \"C:\\Documents and Settings\\Administrator\\Local Settings\\Temp\\image0.jpg\"

      to

      "C:\Documents and Settings\Administrator\Local Settings\Temp\image0.jpg"

      P.S This is a string inside of tag. The \\ in file path made it failed to locate the .jpg file. Thanks,


      modified on Wednesday, February 25, 2009 12:12 AM

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If its a string then you can use replace command. 1. Replace \\ with \ 2. Replace \" with " i hope it will work in most of the cases.

      L 1 Reply Last reply
      0
      • L Lost User

        If its a string then you can use replace command. 1. Replace \\ with \ 2. Replace \" with " i hope it will work in most of the cases.

        L Offline
        L Offline
        LiYS
        wrote on last edited by
        #3

        Thanks for the reply.

        aaCog wrote:

        1. Replace \\ with \

        The question is how should I represent \\ in

        string.replace("\\", '\' )

        without escape sequence? Same thing with \"


        X 1 Reply Last reply
        0
        • L LiYS

          Hi all, How could I transform

          \"C:\\Documents and Settings\\Administrator\\Local Settings\\Temp\\image0.jpg\"

          to

          "C:\Documents and Settings\Administrator\Local Settings\Temp\image0.jpg"

          P.S This is a string inside of tag. The \\ in file path made it failed to locate the .jpg file. Thanks,


          modified on Wednesday, February 25, 2009 12:12 AM

          X Offline
          X Offline
          Xmen Real
          wrote on last edited by
          #4

          string saves \ as \\, so I dont think you can change it in a string variable however if you gonna write in text file or displaying in textbox or anyother control then you can try with string.Replace("\\\\", "\\")

          TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

          L 1 Reply Last reply
          0
          • L LiYS

            Thanks for the reply.

            aaCog wrote:

            1. Replace \\ with \

            The question is how should I represent \\ in

            string.replace("\\", '\' )

            without escape sequence? Same thing with \"


            X Offline
            X Offline
            Xmen Real
            wrote on last edited by
            #5

            LiYS wrote:

            string.replace("\\", '\' )

            it wont work, either both params are type of string or char. No way for one string and another char

            TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

            1 Reply Last reply
            0
            • X Xmen Real

              string saves \ as \\, so I dont think you can change it in a string variable however if you gonna write in text file or displaying in textbox or anyother control then you can try with string.Replace("\\\\", "\\")

              TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

              L Offline
              L Offline
              LiYS
              wrote on last edited by
              #6

              Xmen wrote:

              string.Replace("\\\\", "\\")

              That's another approach I've tried with no luck. The .replace() seems don't take \\\\ as \\


              X L 2 Replies Last reply
              0
              • L LiYS

                Xmen wrote:

                string.Replace("\\\\", "\\")

                That's another approach I've tried with no luck. The .replace() seems don't take \\\\ as \\


                X Offline
                X Offline
                Xmen Real
                wrote on last edited by
                #7

                It would be nice if you explain your main requirement

                TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                L 1 Reply Last reply
                0
                • L LiYS

                  Hi all, How could I transform

                  \"C:\\Documents and Settings\\Administrator\\Local Settings\\Temp\\image0.jpg\"

                  to

                  "C:\Documents and Settings\Administrator\Local Settings\Temp\image0.jpg"

                  P.S This is a string inside of tag. The \\ in file path made it failed to locate the .jpg file. Thanks,


                  modified on Wednesday, February 25, 2009 12:12 AM

                  R Offline
                  R Offline
                  Riaan Booyzen
                  wrote on last edited by
                  #8

                  Perhaps try in your declaration using the @ char before the string ? e.g. string _fileUrl = @"C:\\Documents and Settings\\Administrator\\Local Settings\\Temp\\image0.jpg\";

                  1 Reply Last reply
                  0
                  • X Xmen Real

                    It would be nice if you explain your main requirement

                    TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                    L Offline
                    L Offline
                    LiYS
                    wrote on last edited by
                    #9

                    It's a string inside of tag. The \\ in file path made it failed to locate the .jpg file.


                    X 1 Reply Last reply
                    0
                    • L LiYS

                      Xmen wrote:

                      string.Replace("\\\\", "\\")

                      That's another approach I've tried with no luck. The .replace() seems don't take \\\\ as \\


                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      i dunno what your application is doing, but try using "/" instead of "\". See if it works.

                      1 Reply Last reply
                      0
                      • L LiYS

                        It's a string inside of tag. The \\ in file path made it failed to locate the .jpg file.


                        X Offline
                        X Offline
                        Xmen Real
                        wrote on last edited by
                        #11

                        like this ? code

                        TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                        L 1 Reply Last reply
                        0
                        • X Xmen Real

                          like this ? code

                          TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                          L Offline
                          L Offline
                          LiYS
                          wrote on last edited by
                          #12

                          Xmen wrote:

                          like this ? code

                          Exactly!


                          X 1 Reply Last reply
                          0
                          • L LiYS

                            Xmen wrote:

                            like this ? code

                            Exactly!


                            X Offline
                            X Offline
                            Xmen Real
                            wrote on last edited by
                            #13

                            Its hard to tell, because I dont know how you setting this path in src Attribute...

                            TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                            L 1 Reply Last reply
                            0
                            • X Xmen Real

                              Its hard to tell, because I dont know how you setting this path in src Attribute...

                              TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                              L Offline
                              L Offline
                              LiYS
                              wrote on last edited by
                              #14

                              Xmen wrote:

                              Its hard to tell, because I dont know how you setting this path in src Attribute...

                              Like this:

                              imageNode.SetAttributeValue("src", strpath);

                              where "strpath" is "C:\Documents and Settings\Administrator\Local Settings\Temp\image0.jpg"


                              X 1 Reply Last reply
                              0
                              • L LiYS

                                Xmen wrote:

                                Its hard to tell, because I dont know how you setting this path in src Attribute...

                                Like this:

                                imageNode.SetAttributeValue("src", strpath);

                                where "strpath" is "C:\Documents and Settings\Administrator\Local Settings\Temp\image0.jpg"


                                X Offline
                                X Offline
                                Xmen Real
                                wrote on last edited by
                                #15

                                try this

                                imageNode = document.createElement('img');
                                imageNode.src = strpath;

                                TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                                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