How to check if string character is a space? Char.IsWhiteSpace(char) See also the String.IsNullOrEmpty or String.IsNullOrWhiteSpace.