|
-
Sep 25th, 2000, 03:51 PM
#1
Thread Starter
Hyperactive Member
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?
Thanks.
If you think education is expensive, try ignorance.
-
Sep 25th, 2000, 04:15 PM
#2
Addicted Member
you could do it using the vb mid function
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
that should do it.
-
Sep 25th, 2000, 05:02 PM
#3
Use the Left function.
Code:
Dim strArt As String
Dim FirstChar As String
strArt = "Art"
FirstChar = Left(strArt, 1)
-
Sep 25th, 2000, 05:11 PM
#4
Addicted Member
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.
-
Sep 26th, 2000, 01:16 AM
#5
Thread Starter
Hyperactive Member
thanks to both of you. But I did end up using the LEFT function. I'm sure both do work. Thanks again
If you think education is expensive, try ignorance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|