devxlogo

Test if a Character in a String is a Letter

There is a simple way to test if a character in a string is a letter.Just by using the UCase() And LCase() functions.

     Public Function IsLetter(Char As String) As Boolean    Dim sTemp As String        sTemp = Left$(Char, 1)        IsLetter = (StrComp(UCase(sTemp), LCase(sTemp), vbBinaryCompare) <> 0)    End Function


Note: I use the StrComp function, to make it work independent of Option Compare.

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  How Engineering Leaders Spot Weak Proposals

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.