TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
David Smith
NA
2k
0
Regex help
Jun 25 2013 4:48 PM
I am trying to create another array from the input history array of strings. The new array will have just the On/Off values below. Below my regex will not work because the input history array has datetime stamp included. I trying to either ignore the timestamp or remove the timestamp if that makes sense
history[0]= "1:05:00 PM 06/25/2013 On"
history[1]= "1:10:00 PM 06/25/2013 Off"
history[2]= "1:15:00 PM 06/25/2013 On"
history[3]= "1:20:00 PM 06/25/2013 Off"
history[4]= "1:25:00 PM 06/25/2013 On"
history[5]= "1:30:00 PM 06/25/2013 Off"
static bool ValidateOnOffHistoryFormatSequence(string[] history)
{
///////NewHistory = history
return Regex.IsMatch(String.Join("", NewHistory ), "^(OnOff)+$");
}
Reply
Answers (
1
)
Exception
Test Application