A
A.M-SG
Hi,
I have a .NET type within a string like "System.Int16" or "System.DateTime".
How can I parse and and check if a string contains a valid value from that
type?
I am trying to build a function like this:
IsValidType("123","System.Int16"); // Should return true
IsValidType("1a3","System.Int16"); // Should return false
IsValidType("6/21/2001","System.DateTime"); // Should return true
IsValidType("34/21/2001","System.DateTime"); // Should return false
Is there any wat to create a function like that without using a big
switch(), case element?
Thank you,
Alan
I have a .NET type within a string like "System.Int16" or "System.DateTime".
How can I parse and and check if a string contains a valid value from that
type?
I am trying to build a function like this:
IsValidType("123","System.Int16"); // Should return true
IsValidType("1a3","System.Int16"); // Should return false
IsValidType("6/21/2001","System.DateTime"); // Should return true
IsValidType("34/21/2001","System.DateTime"); // Should return false
Is there any wat to create a function like that without using a big
switch(), case element?
Thank you,
Alan