I'm new to c sharp and I have a small problem.
I have an array A of 4 elements.
I want to check if an element e is part of the array, and if so return the index of this element (which is always unique) and assign it to a variable v.
What's the easiest and shortest way of doing this, in one line if possible ?
Something like var v = A.findNext(a=> a == e);
The problem is that A.findNext doesn't exist, and A.contains only returns a boolean.
Last edited by elishac; October 26th, 2010 at 02:44 PM.