How do I specify I only want the 1st character of a string?
I want to get just the "A". How do I do that?Code:strArt = "Art"
Thanks.
Printable View
How do I specify I only want the 1st character of a string?
I want to get just the "A". How do I do that?Code:strArt = "Art"
Thanks.
you could do it using the vb mid function
that should do it.Code:Dim strArt as String
Dim FirstChar as String
strArt = "Art"
FirstChar = mid$(strArt, 1, 1)'Get the first Character out of the string strArt
Use the Left function.
Code:Dim strArt As String
Dim FirstChar As String
strArt = "Art"
FirstChar = Left(strArt, 1)
I hate using the left method I don't know why, I just prefer to use the mid method over the left and right functions.
Also I showed how to do it using the mid way rather than the left way as he has posted this topic in the general question forum as well and someone has already mentioned the left way in that topic so I thought I'd add a bit of variety for him and put the mid way in this topic lol.
thanks to both of you. But I did end up using the LEFT function. I'm sure both do work. Thanks again