i wus just wondering how to " extract " text from a variable? .. ie : if i had the word Testing in a variable how can i extract the first letter or such? ..
Printable View
i wus just wondering how to " extract " text from a variable? .. ie : if i had the word Testing in a variable how can i extract the first letter or such? ..
dim myvariable as string
myvariable = "Testing"
myfirstletter = left(myvariable, 1)
could ya explain how that works? ... just so i know how to change it around and such? ..
btw thanx very much ... ^_^
-XeoN-
You define your variable
you add some text
you tell it to look as the first character starting from the left.
if you want it to look at the second two characters you can do that too.
mychar = left(myvariable, 2)
and how do i extract stuff after the first letter? ... thx
-XeoN-
I would recommend that you look at the left, right and mid functions. They are very helpful!
http://www.msdn.microsoft.com
eek .. sorry for bugging ... *crys*
-XeoN-
You weren't bugging! We all are hear to learn! Never worry about posting questions.
Good luck!
'here, play around with this
'use a listbox or a msgbox or whatever
'just count things, change things, see what happens
Code:Private Sub Command1_Click()
Dim x As String
x = "help me out here, please."
Dim a As String, b As String, c As String
a = Left(x, 4) 'help
a = Left(x, 1) 'h
a = Left(x, 18) 'help me out here,"
b = Mid(x, 6, 2) ' me
b = Mid(x, 13, 4) 'here
b = Mid(x, 13, 13) 'here, please.
c = Right(x, 7) 'please
c = Right(x, 13) 'here, please.
c = Right(x, 24) 'elp me out here, please.
End Sub
The help files are a great source of information!
Look at "working with variables" and such.
WOOOOOOOOOHOOOOOOOOO! .. thanks guys ... your all so helpful .. i got it to werk ... ^_^ ...
-XeoN-