Friday, 5 October 2007

Command Line Library Minor Update ( RC1)

See the RC1 release page for the means of Minor Update. The Library's tests coverage exceeds the ones created for the Test Driven Development cycle. This makes the code even more stable.
See the CodePlex home for this project, it was completely re-engineered; enjoy!

Thursday, 4 October 2007

System.Char (char) at rescue...

Sometimes is necessery to check if a string (or portion of it) contains numbers, letters or whatever else...
For the ones that "sometimes" (me included...) writes what the BCL already gives you, go to .NET documentation or MSDN online and be happy with System.Char static methods!
All the the following suggestion must be applied to a loop like that:

string s = "Hello 123 123.999 $%&! :_"; //here the input to check
foreach (char c in s)
if (char.******(c))

You want check for...

...integer values? -> char.IsDigit(char_var)

...floating point? -> char.IsDigit(char_var) || char_var == '.'

...plain letters? -> char.IsLetter(char_var)

...everything is white space -> char.IsWhiteSpace(char_var)

...symbols (+, -, etc..) -> char.IsSysmbol(char_var)

and many interesting method to test, parse or check your characters sequence!