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. parenthesis in a string

parenthesis in a string

Scheduled Pinned Locked Moved C#
csharpquestion
5 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.
  • E Offline
    E Offline
    eggie5
    wrote on last edited by
    #1

    How the crap do I put a parenthesis in a string in C#??? I want to do this... string asdf="("; /\ |_ E X E GG

    G D 2 Replies Last reply
    0
    • E eggie5

      How the crap do I put a parenthesis in a string in C#??? I want to do this... string asdf="("; /\ |_ E X E GG

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

      Why not try before you ask? That is exactly how you do it. There is nothing special about having a paranthesis in a string. It's just like any other character. --- b { font-weight: normal; }

      E 1 Reply Last reply
      0
      • G Guffa

        Why not try before you ask? That is exactly how you do it. There is nothing special about having a paranthesis in a string. It's just like any other character. --- b { font-weight: normal; }

        E Offline
        E Offline
        eggie5
        wrote on last edited by
        #3

        how about in java? /\ |_ E X E GG

        D 1 Reply Last reply
        0
        • E eggie5

          How the crap do I put a parenthesis in a string in C#??? I want to do this... string asdf="("; /\ |_ E X E GG

          D Offline
          D Offline
          David Rush
          wrote on last edited by
          #4

          Must be something else you are doing. That should work. The only tricky character is the backslash. It is the escape character for non-printing and control characters, so you have strange constructions like: string abcd = "\"\\\""; That translates to a string containing double-quote backslash double-quote.

          1 Reply Last reply
          0
          • E eggie5

            how about in java? /\ |_ E X E GG

            D Offline
            D Offline
            David Rush
            wrote on last edited by
            #5

            String asdf = "("; Same escape sequence rules in C, C++, C#, and Java.

            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