返回布尔值,判断集合中是否有元素满足某一条件。
source code:
IEnumerable<string> str = new List<string> { "asdf","fgsdfg","tyuiu","ryury","ituyitu" }; if (str.Any(x => x.EndsWith("iu"))) { Write("true"); } else { Write("false"); }
返回布尔值,判断集合中是否有元素满足某一条件。
source code:
IEnumerable<string> str = new List<string> { "asdf","fgsdfg","tyuiu","ryury","ituyitu" }; if (str.Any(x => x.EndsWith("iu"))) { Write("true"); } else { Write("false"); }
相关文章: