C# streamwriter formatting issue
<p>I'd like to thank Stackoverflow member <a href="http://stackoverflow.com/users/231511/pratap-r">Pratap .R</a> first because he helped me with the code.  I'm still have a small formating issue with one of my replace functions.  What is happening is when I replace <code>&lt;/me&gt;</code> it replaces with <code>;</code>.  I can't have the end of the row have a <code>;</code> at the end.</p>

<pre><code>using (FileStream strm = new FileStream(exportfile, FileMode.Create))
{
    using (StreamWriter writer = new StreamWriter(strm))
    {
        SqlCommand cmd = new SqlCommand(sql, con);
        SqlDataReader reader = cmd.ExecuteReader();

        for (int i = 0; i &lt; reader.FieldCount; i++)
            writer.Write((i == 0 ? "" : "|") + reader.GetName(i));

        writer.Write("\n");

        while (reader.Read())
        {
            for (int i = 0; i &lt; reader.FieldCount; i++)
            {
                writer.Write
                (
                    (i == 0 ? "" : "|") +
                    reader[i].ToString().Replace(@"&lt;me&gt; ","")
                        .Replace(@"&lt;/me&gt;", "|").Replace(@"&lt;/me&gt;", ";")
                        .Replace('\n', ' ').Replace('\r', ' ')
                );
            }

            writer.WriteLine();
        }

        reader.Close();
    }
}</code></pre>

<p>So you can see when it occurs with  it's replaced with ";".  I can't have a ; end the row.  Any suggestions or tips always appricated.</p>
