| RE: [aus-dotnet] IsDate function |
- From: Sean Malloy
- Subject: RE: [aus-dotnet] IsDate function
- Date: Tue, 21 Sep 2004 16:21:47 +1000
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
> This is very slow if the input param is null
if the input param being null makes it slow, why don't you place a check for
that first, if null return false or something?
C# version (yelch VB)
bool IsDate(string input)
{
if (input == null || input.Length == 0)
return false;
try
{
DateTime.Parse(input);
return true;
}
catch (FormatException)
{
return false;
}
}
_________________
You are a part of the Australian "dotnet" mailing list.
To unsubscribe send "unsubscribe dotnet" or to re-subscribe send "subscribe dotnet Your Name" in the body of the email to: imailsrv@xxxxxxxxxxx
List managed by: http://www.stanski.com
(Click here for more information on the aus-dotnet mailling list)
- Follow-Ups:
- RE: [aus-dotnet] IsDate function, jmplun
- Prev by Date: Re: [aus-dotnet] ASP.net credentials
- Next by Date: RE: [aus-dotnet] Smartphones
- Previous by thread: Re: [aus-dotnet] Server Controls
- Next by thread: RE: [aus-dotnet] IsDate function
- Index(es):
