Files
2nd/10_Wiki/Dev/Topic_CSharp/CSharp_Strings_Concat.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

4.3 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
csharp-strings-concat C# String Concatenation Programming_Language draft conceptual
string.Concat
+ operator strings C#
C# 문자열 연결
B 0.84 2026-07-04 2026-07-04
csharp
programming-language
w3schools
strings
concatenation
https://www.w3schools.com/cs/cs_strings_concat.php

CSharp String Concatenation

🎯 한 줄 통찰 (One-line insight)

This chapter's own explicit "WARNING!" — that + means addition for numbers but concatenation for strings — is the exact ambiguity already flagged conceptually in the Display Variables chapter, but now the tutorial adds a SECOND, unambiguous alternative (string.Concat(firstName, lastName)) that sidesteps the + overload entirely, giving C# two genuinely different concatenation mechanisms (operator overload vs. static method call) where C++ effectively only has the operator-overload route (std::string::operator+) and C has neither (manual strcat/buffer management). [S1]

🧠 핵심 개념 (Core concepts)

  • + for concatenationfirstName + lastName combines two strings; manual spacing must be added inside the literal ("John " with a trailing space) since concatenation never auto-inserts spaces. [S1]
  • string.Concat() — a static method alternative that concatenates two strings without relying on operator overloading: string.Concat(firstName, lastName). [S1]
  • + ambiguity (explicit warning) — numbers ADD, strings CONCATENATE, using the identical + symbol; the tutorial calls this out with a dedicated "WARNING!" callout box. [S1]
  • Same-symbol, different-type exampleint z = x + y; (numeric, x=10 int, y=20 int) → 30; string z = x + y; (x="10" string, y="20" string) → "1020". [S1]

📖 세부 내용 (Details)

  • Operator concatenation: string firstName = "John "; string lastName = "Doe"; string name = firstName + lastName; Console.WriteLine(name);"John Doe". [S1]
  • Method concatenation: string name = string.Concat(firstName, lastName); — same result via a different mechanism. [S1]
  • Numeric vs. string + side-by-side: int x = 10; int y = 20; int z = x + y; // 30 versus string x = "10"; string y = "20"; string z = x + y; // "1020". [S1]

⚖️ 모순 및 업데이트 (Contradictions & updates)

  • 연결 방식이 두 개로 이중화됨: C++는 사실상 std::string+ 연산자 오버로드 하나에 의존했고 C는 아예 연산자가 없어 strcat 등을 수동으로 써야 했지만, C#은 + 연산자 오버로드와 string.Concat() 정적 메서드라는 두 가지 독립된 문자열 연결 방식을 제공한다는 점이 확인됨. [S1]

🛠️ 적용 사례 (Applied in summary)

동일한 firstName/lastName 두 변수를 +string.Concat() 두 가지 방식으로 각각 연결하는 비교 예제가 원문에서 직접 실전 활용 사례로 제시됨. [S1]

💻 코드 패턴 (Code patterns)

Two independent concatenation mechanisms — operator overload vs. static method (C#):

string firstName = "John ";
string lastName = "Doe";

string name1 = firstName + lastName;              // operator overload
string name2 = string.Concat(firstName, lastName); // static method -- same result

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.84
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-07-04: Initial draft synthesized from the W3Schools "C# String Concatenation" page (Astra wiki-curation, P-Reinforce v3.1 format).