-
Jan 21st, 2000, 07:56 AM
#1
Thread Starter
New Member
If i have a string of text named Zstring, and it currently holds the text:
"Dogs are big"
If I want it to read, for example, the 4th character in the string, which in this case is "s", how do I find that out.
-
Jan 21st, 2000, 08:28 AM
#2
Look up the Mid function.
------------------
Marty
Can you buy an entire chess set in a pawn shop?
-
Jan 21st, 2000, 09:50 AM
#3
you can use the mid function.
to get the fourth letter i believe you would do in this format mid(stringname, startingpoint, length to take)
so you would do Mid(StrName, 4, 1) that will get you the fourth letter.
if you do Mid(StrName, x, 1) it in a for loop from 1 to string length for the x you will go through each letter.
-
Jan 22nd, 2000, 12:00 PM
#4
So Unbanned
If you want to actually select it (highlight)
do this:
Code:
Text1.SelStart = 1
Text1.SelLength = 3
Where if using Mid you'ld:
Code:
Mid$(Str$,SelStart,SelLength)
The first selects it like selecting and highlighting with the mouse.
The second sets it to a varible without highlighting or you could do both.
------------------
DiGiTaIErRoR
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
|