Here\'s a simplified version of what I\'m trying to do:
var days = new Dictionary();
days.Add(1, \"Monday\");
days.Add(2, \"Tuesday\");
..
This is the most clear and concise way in my opinion:
var matchedDays = days.Where(x => sampleText.Contains(x.Value));
if (!matchedDays.Any())
{
// Nothing matched
}
else
{
// Get the first match
var day = matchedDays.First();
}
This completely gets around using weird default value stuff for structs.