C# streamreader if questions
<p>I'm trying to write out the specific line of code that contains the IF statement.  What appears to be happening if it never finds the code i'm looking to call in my if statement and i know it exists, it's a copy and paste.  Also, how do i only write out the specific line that meets the if statement.  Is there one where i should do a foreach?  foreach (redsplitline in redsplitlines)</p>

<p>heres the code:</p>

<pre><code>{
                    string linesplitnew = "ENDOB";
                    string[] redsplitlines = rdrred.ReadToEnd().Split(new string[] { linesplitnew }, StringSplitOptions.None);
                    string redpullline = "*BEGINOB\r\n6*";
                    string redpullline2 = "*BEGINOB\r\n13*";
                    if(redsplitlines.Contains(redpullline))
                    {
                        Console.WriteLine(redsplitlines);
                    }
                    else if(redsplitlines.Contains(redpullline2))
                    {
                        Console.WriteLine(redsplitlines);
                    } 

                }
</code></pre>
