且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查是字母数字

更新时间:2023-02-10 18:36:47

Hello Vijay,

试试这个

字母数字是字母和数字字符的组合。字母数字字符集由数字0到9和字母A到Z组成。例如,这些是字母数字:Vijay1。

Dot Net为我们提供名称空间System.Text 下正则表达式的概念。您也可以使用解决方案1.但我打算使用RegularExpression。你可以根据你的标准修改正则表达式:

Hello Vijay,
Try This
Alphanumeric is a combination of alphabetic and numeric characters.The alphanumeric character set consists of the numbers 0 to 9 and letters A to Z. for example these are the alphanumeric : Vijay1.
Dot Net Provides us the concept of Regular Expressions Under the Name Space System.Text . You Can Use Solution 1 as well.But i Intend to use RegularExpression. you can Modify Regular expression according to ur Criteria:
Private Function IsAlphaNum(ByVal strInputText As String) As Boolean
      Dim IsAlpha As Boolean = False
      If System.Text.RegularExpressions.Regex.IsMatch(strInputText, "^[a-zA-Z0-9]+


然后
IsAlpha = True
否则
IsAlpha = FALS e
结束 如果
返回 IsAlpha
结束 功能
") Then IsAlpha = True Else IsAlpha = False End If Return IsAlpha End Function



^ [a-zA-Z0-9] +


"^[a-zA-Z0-9]+


是一个正则表达式。它告诉你一个字符串可以从大写字符,小字符或者数字并且可以包含超过1个字符的组合。
" is a Regular Expresiion.It Tells u a string can start from capital Characters,Small Characters Or Numbers and can contain combination of more then 1. Characters.