David Smith

David Smith

  • NA
  • 2k
  • 0

Array Sequence Validation

Jun 25 2013 10:17 AM

 
Below I have an array, Im trying to come up with a unique linq or unique slick way to do this to validate My State Field or State Array. The correct sequence is On/Off  , On/Off.
The last entry must always be an Off.

The sequence can not be an Off/Off, Off/On, On/On. If my array has an invalid entry I want to do something. Can someone assist me.
  
Correct Array Below:
         TStamp   State
1:05      On
1:10      Off
1:15      On
1:20      Off
1:25      On
1:30      Off


Wrong Array Below:
         TStamp   State
1:05     On
1:10     On
1:15     On
1:20     Off
1:25     On
1:30     Off

Answers (4)