Tag: c#
-
Regex: Make sure a phone number is 10 digits
I needed a generic validator for a phone number, and I started thinking about the format of the number but at the end of the day I just want to be sure that there are 10 digits in the entry, and the user can decorate that however he or she like with brackets, hyphens, dots […]
-
C#, List.Find() and Predicates
Because I use this just infrequently enough to have to look it up every time… I’m a huge (ab)user of the .NET generic collection classes, but I hate cluttering code with foreach() loops every time that I need to find an item in a collection. Enter the Find() method, which takes a predicate and does […]