Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using com.wms.strings;
- namespace PracticeAssigningDateTimes{
- class DateTimeAssignments{
- static void Main(){
- string[] sToBeParsed = new string[] {
- "7-7-90",
- "July 7, 1990",
- "7/7/1990 18:43:24",
- "Jul the 7th 1990"
- };
- int iSuccessfullyParsed = 0;
- foreach(string p in sToBeParsed)
- {
- if(StringManipulator.ParseableToDateTime(p))
- {
- iSuccessfullyParsed++;
- }
- }
- Console.Write("Of the {0} elements in string array", sToBeParsed.Length);
- Console.Write(" \"sToBeParsed\", ");
- Console.WriteLine("{0} were parseable to DateTime values.",
- iSuccessfullyParsed);
- }
- }
- }
Add Comment
Please, Sign In to add comment