. . Hong Kong Business Software Company
Expert in web-based solutions
Software House in Hong Kong

Microsoft Certified Solution Developer


Chief Architect's Blog on software development

6 Aug 2009

Function Checking string with Alphanumeric and Underscore only
Many programming languages use symbols (e.g. &, +, -, ', *, /, etc) for special purposes. To avoid unexpected error caused by these symbols, developers may sometimes not want users to key in these symbols to system. The following function checks whether the input string contains special symbols and spaces. It returns "true" for string containing Alphanumeric (a-z, A-Z, 1-9) or underscore only and returns "false" if string containing special symbol or space.

Function isAlphaNumericUnderScore(ByVal str As String) As Boolean

     Return Not System.Text.RegularExpressions.Regex.IsMatch(str, "[^\w]+")

End Function

more topics...  

Home | Products | Services | FAQ | Chinese version | Contact Us
© 2008 Bisware Technology Limited. All Rights Reserved.