IsDate

CodeKeep C# Feed Giugno 2nd, 2008

Description: If you must do this at least use tryparse rather than try catch

Link: http://www.codekeep.net/snippets/92bafaf1-4c02-453c-b321-871badfc20a8.aspx

public static bool IsDate(Object obj)
{
	DateTime result;
	return DateTime.TryParse(obj.ToString(), out result);
}

  • .NET
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Comments are closed.

Trackback URI |