I am in the midst of building a program that will parse a giant file down to what I need. So I read in hundreds of lines, I then assign the appropriate lines to an array. I then need to look through each line in the array and figure out positioning because the material I am looking for is embedded within a bunch of garbage. I am able to figure this out by looking for the first instance of the "<" character and the second instance of the ">" character.
So I used IndexOf to find the first index number which worked perfectly. I then want to use the IndexOfAny with additional I believe overloads, one of the character "<" and of a starting index to prevent looking at the first instance of "<".
Here is what I got...
Code:
string specialCharacterStringOne = ">";
char[] specialCharacterStringTwo = new char[1];
specialCharacterStringTwo[0] = '<';
for (g = g; g != z; g++)
{
int specialCharacterOne = outputFile2[g].IndexOf(specialCharacterStringOne);
int specialCharacterTwo = outputFile2[g].IndexOfAny(specialCharacterStringTwo[0], specialCharacterOne);
}
Unfortunately it doesn't like my IndexOfAny and throws the following errors:
Error 4 The best overloaded method match for 'string.IndexOfAny(char[], int)' has some invalid arguments
Error 5 Argument '1': cannot convert from 'char' to 'char[]'
I figured by doing "char[] specialCharacterStringTwo = new char[1];" I would bypass this cannot convert from 'char' to 'char[]' but that doesn't seem to be working and I am now lost.
Bookmarks