Saturday, March 6, 2010

How to Check if a Character is a WhiteSpace using C#.Net

Check if the character is white-space

This can be done using IsWhiteSpace Method in C#/VB.NET as follows

public void check_whitespace()
{
      string sample = " StartsWith";
      MessageBox.Show(Char.IsWhiteSpace(sample, 0).ToString ());
}

No comments:

Post a Comment