Reputation: 435
I have an expression as above in the title. Is it possible to use linq to iterate through an array and evaluate if true or not. example
string[] a = {"es","ag"}
if (string.EndsWith(<1 of N items in a>)==true){//do something}
Upvotes: 3
Views: 2192
Reputation: 22794
if (a.Any(yourString.EndsWith))
{
//your string ends with one of those endings.
}
Upvotes: 6