CSharp examples for System:DateTime Format
Is Date String by regex
using System.Globalization; using System.Text.RegularExpressions; using System.Web; using System.Linq; using System.Collections.Generic; using System;//from w w w .j a va 2 s. c o m public class Main{ public static bool IsDateString(string str) { return Regex.IsMatch(str, @"(\d{4})-(\d{1,2})-(\d{1,2})"); } }