object[] array = new object[4]; array[0] = new StringBuilder(); array[1] = "example"; array[2] = new int[1]; array[3] = "another"; var result = array.OfType(); foreach (var element in result) { Console.WriteLine(element); }
'C#' 카테고리의 다른 글
[C#]특정 조건을 만족하는 배열 Index 찾기 (0) | 2018.10.12 |
---|---|
[C# Linq] 정렬, Orderby ThenBy (0) | 2018.10.12 |
숫자 앞에 0으로 채우기 (0) | 2017.03.31 |
C#] GetType의 활용 (0) | 2017.03.27 |