Files
2nd/10_Wiki/Topic_Programming/Topic_CSharp/CSharp_Strings_Concat.md
T
Antigravity Agent e9cbf23ab5 docs(10_Wiki): Dev 폴더 누락분 반영 — Topic_Programming으로 통합
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영.

- Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들
  (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거.
- Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/
  Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/
  Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이
  존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존).
- Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/
  JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동.
- 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리.
- Topic_Programming 최종 문서 수: 2784 → 3985.
2026-07-05 00:39:13 +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).