다음은 우리의 배열입니다 -
double[] myArr = {20.5, 35.6, 45.7, 55.6, 79.7}; 첫 번째 요소를 얻으려면 First() 메서드를 사용하십시오.
myArr.AsQueryable().First();
전체 코드를 보자 -
예
using System;
using System.Linq;
using System.Collections.Generic;
class Demo {
static void Main() {
double[] myArr = {20.5, 35.6, 45.7, 55.6, 79.7};
double res = myArr.AsQueryable().First();
Console.WriteLine(res);
}
} 출력
20.5