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. string problem...!

string problem...!

Scheduled Pinned Locked Moved C#
helptutorialquestion
10 Posts 3 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.
  • Q Offline
    Q Offline
    QzRz
    wrote on last edited by
    #1

    Hi... I have some text i want to add to a string! The text would look like this: But i have no idea how to do it... i would do like this: string a = ""; But that does not work! Can anyone tell me how to add this to a string..? Thanks! QzRz

    U 2 Replies Last reply
    0
    • Q QzRz

      Hi... I have some text i want to add to a string! The text would look like this: But i have no idea how to do it... i would do like this: string a = ""; But that does not work! Can anyone tell me how to add this to a string..? Thanks! QzRz

      U Offline
      U Offline
      Utku KAYA
      wrote on last edited by
      #2

      Hi, Put '@' character before the string to inhibate the effect of inner quotes. string a = @""; To add a string to another use String.Concat(string str1 , string str2, .... ); These will work if I got your problem right.

      Q 1 Reply Last reply
      0
      • U Utku KAYA

        Hi, Put '@' character before the string to inhibate the effect of inner quotes. string a = @""; To add a string to another use String.Concat(string str1 , string str2, .... ); These will work if I got your problem right.

        Q Offline
        Q Offline
        QzRz
        wrote on last edited by
        #3

        well... it does not work... :( i did this: string a = @""; I am using microsoft visual studio .net 2002! And it puts a red line under '1.0" encoding=@"utf-8"?>"' and i cannot debug! Do you have another idea of how to solve this...? Thanks...! QzRz

        S 1 Reply Last reply
        0
        • Q QzRz

          well... it does not work... :( i did this: string a = @""; I am using microsoft visual studio .net 2002! And it puts a red line under '1.0" encoding=@"utf-8"?>"' and i cannot debug! Do you have another idea of how to solve this...? Thanks...! QzRz

          S Offline
          S Offline
          Stefan Troschuetz
          wrote on last edited by
          #4

          Escape the quotation marks.

          string a = "";


          www.troschuetz.de

          Q 1 Reply Last reply
          0
          • S Stefan Troschuetz

            Escape the quotation marks.

            string a = "";


            www.troschuetz.de

            Q Offline
            Q Offline
            QzRz
            wrote on last edited by
            #5

            Escape the quotation marks. What does that mean? do not understand: string a = ""; :confused: QzRz

            S 1 Reply Last reply
            0
            • Q QzRz

              Escape the quotation marks. What does that mean? do not understand: string a = ""; :confused: QzRz

              S Offline
              S Offline
              Stefan Troschuetz
              wrote on last edited by
              #6

              Sorry, i forgot to check the "Do not treat <'s as HTML tags" option. Here it is again. string a = "";

              Q 1 Reply Last reply
              0
              • S Stefan Troschuetz

                Sorry, i forgot to check the "Do not treat <'s as HTML tags" option. Here it is again. string a = "";

                Q Offline
                Q Offline
                QzRz
                wrote on last edited by
                #7

                It still gives me same problem! Nomatter if i write: string a = @""; or string a = ""; it still wont work...! QzRz

                S 1 Reply Last reply
                0
                • Q QzRz

                  Hi... I have some text i want to add to a string! The text would look like this: But i have no idea how to do it... i would do like this: string a = ""; But that does not work! Can anyone tell me how to add this to a string..? Thanks! QzRz

                  U Offline
                  U Offline
                  Utku KAYA
                  wrote on last edited by
                  #8

                  Do not use quotation marks '"' for 1.0 and utf-8, you can use single quotes. If this will be an XML file I have checked single quote before and it has worked.

                  1 Reply Last reply
                  0
                  • Q QzRz

                    It still gives me same problem! Nomatter if i write: string a = @""; or string a = ""; it still wont work...! QzRz

                    S Offline
                    S Offline
                    Stefan Troschuetz
                    wrote on last edited by
                    #9

                    It's definitely not my day: this time i forgot to escape the quotation marks. Let's give it one more try ;) string a = "";

                    Q 1 Reply Last reply
                    0
                    • S Stefan Troschuetz

                      It's definitely not my day: this time i forgot to escape the quotation marks. Let's give it one more try ;) string a = "";

                      Q Offline
                      Q Offline
                      QzRz
                      wrote on last edited by
                      #10

                      that works... thanks...! :) QzRz

                      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