Your technology certification is waiting. Enroll in Cloud Class ®
Dim lngIndex As Long
For lngIndex = 1 To Len(MyString)
If Not IsNumeric(Mid(MyString, lngIndex, 1)) Then
MsgBox Mid(MyString, lngIndex, 1)
Open in new window
SELECT Left(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace([Yourstring],'0',''),'1',''),'2',''),'3',''),'4',''),'5',''),'6',''),'7',''),'8',''),'9',''),1) AS Expr1
Function ReturnFirstLetter(strData as string) as String
Dim Done as Boolean
Done = False
'Lets recursively select the first character of the string
Do until Done = True
if Len(StrData) = 0 then
ReturnFirstLetter ="No Letter!"
Done = True
'Check if it's a number
If isNumeric(Left(StrData,1)) = True
ReturnFirstLetter = Left(StrData,1)
Done = True
'trim off the leftmost character if it isn'y
StrData = Right(StrData, Len(StrData)-1)
The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.