For Programmers: Free Programming Magazines  


Home > Archive > C# > April 2006 > How to check the format of a string before pasing?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to check the format of a string before pasing?
LarsDahl

2006-04-11, 3:00 am

When I parse a string to a type, I do it in a try-catch-FormatException block.

I ask: Are there a way to do it without try-catch?

Well, I can see it should be possible to do it by regular expressions, but are there any "standard" defined patterns to match the string at?

or another way?
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com