我在标题中有一个表达式.是否可以使用linq迭代数组并评估是否为真.例
string[] a = {"es","ag"}
if (string.EndsWith(<1 of N items in a>)==true){//do something}
Run Code Online (Sandbox Code Playgroud)
if (a.Any(yourString.EndsWith))
{
//your string ends with one of those endings.
}
Run Code Online (Sandbox Code Playgroud)