I want to compare one string with the string array because I need to match a phone number if it starts with some specific number then I need to do something.
Here is what I'm doing now. But I want to make this simpler.
string[] startNumList = new string[] {"4", "5", "6", "7", "8" };
foreach (string x in startNumList)
{
if(request.ReferenceNumber.StartsWith(x))
{
//do something
}
}
I was jut wondering if this is possible to do the same with one line LINQ. Thanks in advance.
//do something?