[C#/General] String.Split 사용법


[C#/General] String.Split 사용법

> 기본적인 String.Split 사용. 공백을 구분자로 한 분리. string phrase = "brown red yellow gray black"; string[] colors = phrase.Split(' '); foreach (var color in colors) { System.Console.WriteLine($""); } > 특정 delimiterChars (구분자로 사용되는 Char 집합의 사용) char[] delimiterChars = { ' ', ',', '.', ':', '\t' }; string text = "white\tred :,yellow gray black"; System.Console.WriteLine($"원본 텍스트: '{text}'"); string[] words = ..


원문링크 : [C#/General] String.Split 사용법