당신은 두 배로 문자열을 변환 할 double.Parse 방법을 사용할 수 있습니다
var tmp3 = myregex.Matches(text_to_split);
foreach (Match match in tmp3)
{
double value = double.Parse(match.Value);
// TODO : do something with the matches value
}
그리고 당신이 나 같은 LINQ와 함수형 프로그래밍 팬이라면 당신은 쓸모없는 루프를 저장하고 직접 MatchCollection
IEnumerable<double>
로 변환 할 수 있습니다 : 정적 배열을 필요한 경우
var tmp3 = myregex.Matches(text_to_split);
var values = tmp3.Cast<Match>().Select(x => double.Parse(x.Value));
및 추가 .ToArray()
호출이 필요할 수 있습니다
당신이
안전 변환을 원하는 경우
var tmp3 = myregex.Matches(text_to_split);
var values = tmp3.Cast<Match>().Select(x => double.Parse(x.Value)).ToArray();
당신은 double.TryParse 방법을 사용하지만 수있는 정규 표현식이 충분하고 문자열이 확인을해야 적절한 형식으로되어 있음을 보장 한 경우.
이것은 정확히 내가 찾고있는 것입니다. –