e9cbf23ab5
이전 재구성 작업에서 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.
4.2 KiB
4.2 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-access | C# Access Strings | Programming_Language | draft | conceptual |
|
B | 0.84 | 2026-07-04 | 2026-07-04 |
|
|
CSharp Access Strings
🎯 한 줄 통찰 (One-line insight)
myString[0] reuses the identical square-bracket index syntax from C's raw char arrays and C++'s std::string::operator[], 0-indexed exactly the same way — but C# then layers IndexOf() and Substring() on top as a matched PAIR designed to work together (name.Substring(name.IndexOf("D")) finds a position, then slices from it), a "search then slice" combo pattern this wiki hasn't seen expressed this explicitly in C/C++ (C++'s std::string::find() + substr() do the same job but the tutorial there never demonstrated them chained as a single idiom the way this C# chapter does). [S1]
🧠 핵심 개념 (Core concepts)
[]indexing — access a single character by index, 0-based:myString[0]is the first character. [S1].IndexOf(char)— returns the index position of the FIRST occurrence of a specified character/substring. [S1].Substring(startIndex)— extracts and returns a NEW string starting from the given index to the end. [S1]- Combined idiom: search-then-slice —
IndexOf()locates a position, and that position is fed directly intoSubstring()to extract everything from that point onward (e.g. isolating a last name from a full name). [S1]
📖 세부 내용 (Details)
- Basic indexing:
string myString = "Hello"; Console.WriteLine(myString[0]); // "H"andmyString[1]; // "e". [S1] - Search:
string myString = "Hello"; Console.WriteLine(myString.IndexOf("e")); // 1. [S1] - Combined search+slice:
string name = "John Doe"; int charPos = name.IndexOf("D"); string lastName = name.Substring(charPos); Console.WriteLine(lastName);→"Doe". [S1]
⚖️ 모순 및 업데이트 (Contradictions & updates)
- 대괄호 인덱싱 문법은 C/C++와 동일:
myString[0]이 0부터 시작하는 인덱스로 문자에 접근하는 방식이 C 배열, C++의std::string::operator[]와 차이가 없다는 점이 확인됨. [S1] - IndexOf+Substring 조합 관용구가 명시적으로 제시됨: C++도
find()+substr()로 동일한 일을 할 수 있었지만, Topic_CPP의 문자열 챕터에서는 두 메서드를 체이닝하는 관용구가 이렇게 명시적으로 다뤄지지 않았다는 점이 이번 챕터에서 새롭게 확인됨 — "찾고 나서 자르기"라는 하나의 패턴으로 제시됨. [S1]
🛠️ 적용 사례 (Applied in summary)
"John Doe"라는 전체 이름에서 "D"의 위치를 찾아 그 위치부터 Substring()으로 성(lastName)만 추출하는 예제가 원문에서 직접 실전 활용 사례로 제시됨. [S1]
💻 코드 패턴 (Code patterns)
Search-then-slice idiom combining IndexOf() and Substring() (C#):
string name = "John Doe";
int charPos = name.IndexOf("D"); // find position of "D"
string lastName = name.Substring(charPos); // slice from that position -> "Doe"
Console.WriteLine(lastName);
✅ 검증 상태 및 신뢰도
- 상태: draft
- 검증 단계: conceptual
- 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
- 신뢰 점수: 0.84
- 중복 검사 결과: 신규 생성 (New discovery)
🔗 지식 그래프 (Knowledge Graph)
- 상위/루트: C# Tutorial
- 관련 개념: CSharp Strings Interpol, CSharp Strings Chars, CPP Strings Access
- 참조 맥락: Strings 섹션 — Special Characters 챕터로 이어짐.
📚 출처 (Sources)
- [S1] W3Schools — C# Access Strings — https://www.w3schools.com/cs/cs_strings_access.php
📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "C# Access Strings" page (Astra wiki-curation, P-Reinforce v3.1 format).