I've got some Java code along the lines of:
Vector<String> allLines = new Vector<String>();
allLines.add("line 1");
allLines.add("line 2");
allLines.add("line 3");
for (String currLine: allLines) { ... }
Basically, it reads a big file into a lines vector then processes it one at a time (I bring it all in to memory since I'm doing a multi-pass compiler).
What's the equivalent way of doing this with C#? I'm assuming here I won't need to revert to using an index variable.
Actually, to clarify, I'm asking for the equivalent of the whole code block above, not just the for
loop.