Question substring help

RAWRcoder

New member
Joined
Jul 1, 2010
Messages
1
Programming Experience
1-3
Hi. well im makign a game that reads text files off of an ftp server. everything is working great. except for the fact that i cant read more then the first line of the players text file. how would i use substring to, for example, look for 'inventory' and get all the info under 'inventory' and above the next title?
 
I have moved your thread to a more appropriate forum.

Perhaps you should show us what the file format looks like, what you're actually doing at the moment and explain where it goes wrong.
 
Perhaps your looking for a line by line approach. You can do this:

VB.NET:
Dim x as string=my.Computer.FileSystem.ReadAllText("c:\file.txt")

for each line as string in x.Split(vbcrlf)

msgbox(line)

next
 
DaleXL

Try this version instead :)

VB.NET:
Dim x() as string=my.Computer.FileSystem.ReadAllLines("c:\file.txt")

for each line as string in x

msgbox(line)

next
 
Hi. well im makign a game that reads text files off of an ftp server. everything is working great. except for the fact that i cant read more then the first line of the players text file. how would i use substring to, for example, look for 'inventory' and get all the info under 'inventory' and above the next title?

You wouldn't.. Read the file line by line instead. When you encounter "inventory" capture all the following data into some class, until you reach the next title
 
Back
Top