5
MatchCollection을 string 형 배열로 변환
MatchCollection을 문자열 배열로 변환하는 이보다 더 좋은 방법이 있습니까? MatchCollection mc = Regex.Matches(strText, @"\b[A-Za-z-']+\b"); string[] strArray = new string[mc.Count]; for (int i = 0; i < mc.Count;i++ ) { strArray[i] = mc[i].Groups[0].Value; } 추신 : mc.CopyTo(strArray,0)예외가 발생합니다. 소스 배열에서 하나 이상의 요소를 대상 배열 유형으로 캐스트 할 수 없습니다.