|
-
June 14th, 2010, 08:25 AM
#9
Re: Complicated Project NEED HELP
How would i get the code to store the text for every line between the beginning and end.
I kno the code to "mark" the beginning and "end" of a class but how would i get it to continuously store the text into another array until the end of the class?
string[] lines = File.ReadAllLines(@"c:\Ucore.cs");
foreach (string line in lines)
{
MatchCollection url = regex.Matches(line);
textBox1.Text = line;
if (line.Contains("["))
{
righter = righter + 1;
store.Add(line);
//SOMEHOW STORE ALL THE TEXT IN CLASS
}
else if (line.Contains("]") )
{
lefter = lefter + 1;
SOMEHOW STOP STORING TEXT
}
This is what i have to mark the beginning and end of a class...
How would i get the code to continuously store code until it reaches the end of the class? I know this is probably wrong because it would only store the text in the array everytime "[" appears in a line, but how would i go about storing it anyway?
Also is it possible to "close" an array so it would stop storing the text?
andddddd(sorry for all the questions guys).....how would i have the loop to continue this cycle of storing text until it reaches the end of the file?
Tags for this Thread
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
|