ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods
Checks if a string contains no spaces
public static bool ContainsNoSpaces(this string s) { var regex = new Regex(@"^[a-zA-Z0-9]+$"); return regex.IsMatch(s); }
if (!textBoxUserIdNew.Text.Trim().ContainsNoSpaces())
Author: R. van Duren
Submitted on: 4 sep. 2008
Language: C#
Type: System.String
Views: 4450