I am sitting here writing some code, in C# for my next video and for some reason I cannot seem to remember the C# Escape Sequences for "New Line" and "Double Quotes."  They are easy enough to find on line, but since I've just found them again, I am posting this entry for anyone who might be "banging their heads on the keyboard" like I was, trying to remember them. 

C# Escape Sequence List

  • \' - single quote, needed for character literals
  • \" - double quote, needed for string literals
  • \\ - backslash
  • \0 - Unicode character 0
  • \a - Alert (character 7)
  • \b - Backspace (character 8)
  • \f - Form feed (character 12)
  • \n - New line (character 10)
  • \r - Carriage return (character 13)
  • \t - Horizontal tab (character 9)
  • \v - Vertical quote (character 11)
  • \uxxxx - Unicode escape sequence for character with hex value xxxx
  • \xn[n][n][n] - Unicode escape sequence for character with hex value nnnn (variable length version of \uxxxx)
  • \Uxxxxxxxx - Unicode escape sequence for character with hex value xxxxxxxx (for generating surrogates)

     

    You know, I used to be a Visual Basic (1.0-6.0 and VB.NET) Developer, doing all of my code in the VB Syntax until about 3 years ago.  Sometimes, I think about switching back to doing all of my code samples in VB for my own sanity.  I know that many of you will disagree, but I really liked the syntax much better. 

    Let the Anti-VB flame-war begin! Nerd

    ~ Robert Shelton

    Share this post :

    Subscribe to Sheltonblog.com

    ↑ Grab this Headline Animator

    Technorati Tags: ,,