请问如何判断一个字符串中的字符是数字还是字母?

解决方案 »

  1.   

    isnumeric("1234")
      
    *****************************************************************************
    欢迎使用CSDN论坛阅读器 : CSDN Reader(附全部源代码) 
    http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
      

  2.   

    isNumeric("1234") 这样 能判断是否为数字 ,但是并不一定就是 字母!
      

  3.   

    根据ASCII码吧
    或者用这个来比较
    If Trim(Val(Text1.Text))=Text1.Text Thenend if
    呵呵
    个人看法
    http://hi.baidu.com/2427
      

  4.   

    循环取字符串中的单个字符,得到其ASCII码ccc,ccc在48与57之间的就是数字,在65到90或97到122之间的就是字母(大写或小写),这不是很简单吗?
      

  5.   

    icbcnbxs(我来灌水) 正解 
    例题:程序内包括一个text1 和 一个command1
    -------------------------------
    Option ExplicitPrivate Sub Command1_Click()
    Dim a As String
    a = Text1
    If Asc(a) >= 48 And Asc(a) <= 57 Then Cls: Print "数字" & Asc(a)
    If Asc(a) >= 65 And Asc(a) <= 90 Then Cls: Print "大写" & Asc(a)
    If Asc(a) >= 97 And Asc(a) <= 122 Then Cls: Print "小写" & Asc(a)
    End Sub
    ---------------------------------
      

  6.   

    dim a as string,i as integer
    a="1234ADNBC 在苛在职"for i=1 to len(a)
        if isnumeric(mid(a,i,i+1)) then debug.print "是数字"
    next