--- id: csharp-strings-chars title: "C# Special Characters" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["escape characters C#", "\\n \\t \\\" C#", "C# 특수 문자"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.83 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["csharp", "programming-language", "w3schools", "strings", "escape-characters"] raw_sources: ["https://www.w3schools.com/cs/cs_strings_chars.php"] applied_in: [] github_commit: "" --- # [[CSharp Special Characters]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) Every escape sequence in this chapter (`\'`, `\"`, `\\`, `\n`, `\t`, `\b`) is character-for-character identical to C and C++'s escape sequences, making this the third "zero divergence" chapter in the C# series so far (after Comments and Operators) β€” the pattern across all three is that C#'s LEXICAL-LEVEL syntax (tokens, literals, comments, escapes) stays fully compatible with the C family, while its STRUCTURAL rules (mandatory classes, `.Length` as property not method, `Convert.To*`) are where the real divergence happens. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Why escapes are needed** β€” a double quote inside a double-quoted string literal breaks parsing; C# needs a way to include one. [S1] - **`\'`** β€” inserts a single quote. [S1] - **`\"`** β€” inserts a double quote. [S1] - **`\\`** β€” inserts a single backslash. [S1] - **`\n`** β€” new line. [S1] - **`\t`** β€” tab. [S1] - **`\b`** β€” backspace. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Broken (unescaped) example shown deliberately as an error case: `string txt = "We are the so-called "Vikings" from the north.";` β€” the tutorial shows this fails, then fixes it with `\"`. [S1] - Fixed: `string txt = "We are the so-called \"Vikings\" from the north.";`. [S1] - Single quote escape: `string txt = "It\'s alright.";`. [S1] - Backslash escape: `string txt = "The character \\ is called backslash.";`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - **μ΄μŠ€μΌ€μ΄ν”„ μ‹œν€€μŠ€κ°€ C/C++와 μ™„μ „νžˆ 동일**: `\' \" \\ \n \t \b` μ „λΆ€ C/C++와 κΈ°ν˜ΈΒ·μ˜λ―Έκ°€ λ™μΌν•˜λ‹€λŠ” 점이 확인됨 β€” Comments, Operators에 이은 μ„Έ 번째 "μ™„μ „ 동일" 챕터. μ΄λŠ” C#의 μ–΄νœ˜ μˆ˜μ€€ 문법(토큰/λ¦¬ν„°λŸ΄/주석/μ΄μŠ€μΌ€μ΄ν”„)이 C 계열과 μ™„μ „νžˆ ν˜Έν™˜λ˜λŠ” 반면, ꡬ쑰적 κ·œμΉ™(클래슀 κ°•μ œ, .Length ν”„λ‘œνΌν‹°, Convert.To* λ“±)μ—μ„œλ§Œ μ‹€μ§ˆμ μœΌλ‘œ κ°ˆλΌμ§„λ‹€λŠ” νŒ¨ν„΄μ„ λ³΄μ—¬μ€Œ. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” ν°λ”°μ˜΄ν‘œ/μž‘μ€λ”°μ˜΄ν‘œ/λ°±μŠ¬λž˜μ‹œλ₯Ό μ΄μŠ€μΌ€μ΄ν”„ν•΄ λ¬Έμžμ—΄μ— ν¬ν•¨μ‹œν‚€λŠ” μ˜ˆμ œκ°€ μ›λ¬Έμ—μ„œ μ œμ‹œλ¨. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Escape sequences β€” identical to C/C++ (C#): ```csharp string txt1 = "We are the so-called \"Vikings\" from the north."; string txt2 = "It\'s alright."; string txt3 = "The character \\ is called backslash."; ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.83 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[C# Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSharp Strings Access]], [[CSharp Booleans]], [[CPP Strings Esc]] - **μ°Έμ‘° λ§₯락:** Strings μ„Ήμ…˜μ˜ λ§ˆμ§€λ§‰ 챕터 β€” Booleans μ„Ήμ…˜μœΌλ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” C# Special Characters β€” https://www.w3schools.com/cs/cs_strings_chars.php ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "C# Special Characters" page (Astra wiki-curation, P-Reinforce v3.1 format).