I need to check in string.Endswith(\"\") from any of the following operators: +,-,*,/
If I have 20 operators I don\'t want to use ||<
How about:-
string input = .....;
string[] matches = { ...... whatever ...... };
foreach (string match in matches)
{
if (input.EndsWith(match))
return true;
}
I know it is dreadfully old school to avoid LINQ in this context, but one day you will need to read this code. I am absolutely sure that LINQ has its uses (maybe i'll find them one day) but i am quite sure it is not meant to replace the four lines of code above.