C# defines the following character escape sequences:

  • \' - single quote, needed for character literals
  • \" - double quote, needed for string literals
  • \\ - backslash
  •  - 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)

Of these, \a\f\v\x and \U are rarely used in my experience.

相关文章:

  • 2021-08-10
  • 2022-01-04
  • 2022-01-19
  • 2021-06-21
  • 2021-04-09
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-26
  • 2021-06-04
  • 2021-11-01
  • 2021-12-09
  • 2021-07-26
  • 2021-07-12
  • 2022-12-23
相关资源
相似解决方案