Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Date in excel sheet, i'm try to load the date into string object.
Here when i try to load the date into page itself then i want to check the condition if the date format is "dd-MMM-yy", then display correct date other wise error message.

EX:
C#
string date="11-Feb-13";

if(date is "dd-MMM-yy")
//insertion
else
//error message


Here i'm confusing about the highlited one.How can i check that if condition any help regarding this issue...
Posted

1 solution

Use Regular Expressions[^].

Example patterns you'll find here: http://www.regular-expressions.info/dates.html[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900