|
-
Feb 4th, 2000, 08:12 AM
#1
Thread Starter
New Member
In a program I'm using to edit certain aspects of a configuration file, I read the entire contents of the file into an array (each index representing one line of the array).
Then, using a for loop I'd like to go through the array until I find a line that STARTS WITH "DataEntry1" (minus the quotes). The problem is there will probably be text AFTER that DataEntry1 like someone's name, or something like that.
Basically, how do I find a string within a string. Using Perl this would be a lot easier for me, but I need to do this in VB for other reasons, obviously.
Thanks
-Morg
-
Feb 4th, 2000, 08:16 AM
#2
Look up the InStr function. Other useful functions for you will probably be Mid and/or Left. If you look up any one of them, you can easily find info on all of VBs built-in string functions.
------------------
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"
-
Feb 4th, 2000, 10:53 AM
#3
Thread Starter
New Member
You rock, thanks man 
I already knew about Left, Right, Mid, etc...
Didn't know the "InStr" function existed. Helps a lot in my program. Thanks again
-Morg
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
|