How to repeat this for every line in rich text box?
<p>I am currently making myself a little tool. </p>

<p>Essentially I have this list which goes like this:</p>

<pre><code>NPWR00160_00 LittleBigPlanet
NPWR00163_00 Warhawk
NPWR00179_00 Pure
NPWR00180_00 Midnight Club: Los Angeles
NPWR00181_00 echochrome™
NPWR00187_00 WipEout® HD
</code></pre>

<p>This is currently typed into a richTextBox.</p>

<p>I am trying to do this, get the NPWRXXXXXX of the line and save it as a string, and then the Games Name and save that as another string for which I can go ahead and do what I was originially going to do with it. But for each line of the richTextBox which carries on with that formation as above.</p>

<p>Not too sure how to get a line from the richTextBox and save it as a string, in which I can repeat that process for every single line of the richTextBox.</p>

<p>For what I have tried, I gave myself an example that the string was NPWR02727_00 Skydive: Proximity Flight. What I did was this:</p>

<pre><code>    string game = "NPWR02727_00 Skydive: Proximity Flight";
    string NPWR = game.Substring(0,13);
    string gamename = game.Remove(0, 13);
    richTextBox2.AppendText("NPWRID: " + NPWR + " Game: " + gamename + Environment.NewLine);
</code></pre>

<p>Which actually does successfully save the strings and write it in the second text box as the new form.</p>

<p>Only issue is I'm not sure how to convert a line from the RichTextBox and turn it into a string, and repeat the process for each line in the rich text box</p>

<p><strong>EDIT</strong></p>

<p>So I found out how to turn a string into a line from the richTextBox..</p>

<p><code>string line = richTextBox1.Lines[0];</code></p>

<p>So this will get the first line and save it as the string "line"</p>

<p>This now updates the code to</p>

<pre><code>string game = richTextBox1.Lines[0];
string NPWR = game.Substring(0,13);
string gamename = game.Remove(0, 13);
richTextBox2.AppendText("NPWRID: " + NPWR + " Game: " + gamename + Environment.NewLine);
</code></pre>

<p>Now how do I get this code to run for every line, I understand I need something to repeat it, and something to change the <code>0</code> to count up by 1 everytime it repeats?</p>

<p><strong>EDIT AGAIN</strong></p>

<p>Awesome, forget the above edit, thanks a lot!</p>