'이스케이프'에 해당되는 글 1건

  1. 2010.12.09 C# 과 JAVA 의 이스케이프 코드 차이점
  • Escape sequences

    inside char and String literals include:
    ' ' space
    '\u003f' Unicode hex, (must be exactly 4 digits to give a 16-bit Unicode number ). \u2007 is Figure Space, a space as wide as a digit, to help in aligning numbers.
    '\n' newline, ctrl-J (10, x0A)
    '\b' backspace, ctrl-H (8, 0x08)
    '\f' formfeed, ctrl-L (12, 0x0C)
    '\r' carriage return, ctrl-M (13, 0x0D)
    '\t' tab, ctrl-I (9, 0x09)
    '\\' backslash,
    '\'' single quote (optional inside " "),
    '\"' double quote (optional inside ' '),
    '\377' octal (must be exactly 3 digits. You can get away with fewer, but then you create an ambiguity if the character following the literal just happens to be in the range 0..7.). This lets you get at only the 8-bit characters in the range 0..377 octal or 0..255 decimal or 0..255 decimal, which still gives you 16-bit Unicode.
    \007 bel, ctrl-G (7, 0x07)
    \010 backspace, ctrl-H (8, 0x08)
    \013 vt vertical tab, ctrl-K (11, 0x0B)
    \032 sub (used in DOS/CPM as eof), ctrl-Z (26, 0x1A)
    \033 esc ctrl-^ (27, 0x1B)
  •  

  • C# Escape sequences


  • \' - 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)
  • C# \xn[n][n][n] 의 추가 설명
    16진수 이스케이프 시퀀스에는 다양한 자릿수의 16진수를 사용할 수 있습니다. 문자열 리터럴 "\x123"에는 16진수 값이 123인 문자 하나가 포함됩니다. 16진수 값이 12인 문자 다음에 문자 3이 오는 문자열을 만들려면 "\x00123"이나 "\x12" + "3"을 사용하십시오.

    Posted by 김반장78
    ,