Anyの読み方
C#で利用できる関数の1つである「Any」の読み方を掲載してます。
読み⽅
「エニイ」と読みます。
英訳
「任意の」という意味があります。
Anyとは
C#では、リストに条件を満たす値が1つでも含まれていると「true」を返します。
using System;
using System.Collections.Generic;
using System.Linq;
namespace testapp
{
class Program
{
static void Main(string[] args)
{
// Listを用意
var list = new List<int> {1,2,3};
try
{
bool reault1 = list.Any(v => v > 2);
Console.WriteLine($"実行結果は{reault1}です"); //true
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
}
-
前の記事
TRANSACTIONの読み方 2021.09.24
-
次の記事
RESEEDの読み方 2021.09.25