ARTICLE AD BOX
I have a dictionary of type Dictionary<string, string>, each item of which has the day of week as the key, with the hours of operation as the value. The items might look like this:
[0] {[Sun, CLOSED]} [1] {[Mon, 9:00 AM - 5:00 PM]} [2] {[Tue, 9:00 AM - 5:00 PM]} [3] {[Wed, 9:00 AM - 5:00 PM]} [4] {[Thu, CLOSED]} [5] {[Fri, 9:00 AM - 6:00 PM]} [6] {[Sat, 9:00 AM - 2:00 PM]}I'd like to simplify the dictionary so that consecutive matching item values are condensed to this (note that Mon, Tues, and Wed have same consecutive hours of operation and are grouped and separated by a hyphen):
[0] {[Sun, CLOSED]} [1] {[Mon - Wed, 9:00 AM - 5:00 PM]} [2] {[Thu, CLOSED]} [3] {[Fri, 9:00 AM - 6:00 PM]} [4] {[Sat, 9:00 AM - 2:00 PM]}The answer seems so simple, but I've been banging my head against the wall. lol
Any thoughts?
