在 VB6 中确定字符是否为字母的最佳方法是什么? [英] What's the best way to determine if a character is a letter in VB6?
本文介绍了在 VB6 中确定字符是否为字母的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
需要一个函数,将字符作为参数,如果是字母则返回真.
Need a function that takes a character as a parameter and returns true if it is a letter.
推荐答案
Seanyboy 的 IsCharAlphaA
answer 很接近.最好的方法是像这样使用W版本:
Seanyboy's IsCharAlphaA
answer is close. The best method is to use the W version like so:
Private Declare Function IsCharAlphaW Lib "user32" (ByVal cChar As Integer) As Long
Public Property Get IsLetter(character As String) As Boolean
IsLetter = IsCharAlphaW(AscW(character))
End Property
当然,这一切都无关紧要,因为 VB6 的所有控件都只有 ANSI
Of course, this all rarely matters as all of VB6's controls are ANSI only
这篇关于在 VB6 中确定字符是否为字母的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文