I'm trying to get the next item in a list of strings (postal codes). Normally I'd just foreach till I find it and then get the next in the list but I'm trying to be a bit more intuitive and compact than that (more of an exercise than anything).
I can find it easily with a lambda:
List<string> postalCodes = new List<string> { "A1B", "A2B", "A3B" };
currentPostalCode = "A2B";
postalCodes.Find((s) => s == currentPostalCode);
Which is cool and all, and I properly get "A2B", but I'd prefer the index than the value.