private bool IsWhiteSpace(string s) { bool onlyWhitespace = true; foreach (char c in s) if (!Char.IsWhiteSpace (c)) { onlyWhitespace = false; break; } return onlyWhitespace; }