|
-
Dec 4th, 2000, 06:22 PM
#1
Thread Starter
New Member
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? ..
-
Dec 4th, 2000, 06:25 PM
#2
Hyperactive Member
dim myvariable as string
myvariable = "Testing"
myfirstletter = left(myvariable, 1)
-
Dec 4th, 2000, 06:29 PM
#3
Thread Starter
New Member
could ya explain how that works? ... just so i know how to change it around and such? ..
btw thanx very much ... ^_^
-XeoN-
-
Dec 4th, 2000, 06:46 PM
#4
Hyperactive Member
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)
-
Dec 4th, 2000, 06:47 PM
#5
Thread Starter
New Member
and how do i extract stuff after the first letter? ... thx
-XeoN-
-
Dec 4th, 2000, 06:49 PM
#6
Hyperactive Member
I would recommend that you look at the left, right and mid functions. They are very helpful!
http://www.msdn.microsoft.com
-
Dec 4th, 2000, 06:53 PM
#7
Thread Starter
New Member
eek .. sorry for bugging ... *crys*
-XeoN-
-
Dec 4th, 2000, 06:56 PM
#8
Hyperactive Member
Please, don't cry!
You weren't bugging! We all are hear to learn! Never worry about posting questions.
Good luck!
-
Dec 4th, 2000, 07:16 PM
#9
_______
<?>
'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
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Dec 4th, 2000, 07:23 PM
#10
Addicted Member
The help files are a great source of information!
Look at "working with variables" and such.
-
Dec 4th, 2000, 08:03 PM
#11
Thread Starter
New Member
WOOOOOOOOOHOOOOOOOOO! .. thanks guys ... your all so helpful .. i got it to werk ... ^_^ ...
-XeoN-
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
|