How to remove mentioned characters from network stream string
<p>I am doing telnet from a web page using TcpClient  </p>

<pre><code>server = new TcpClient(ConfigurationManager.AppSettings["DynamicIP"], Convert.ToInt32(ConfigurationManager.AppSettings["DynamicPort"]));
            ns = server.GetStream();
</code></pre>

<p>While reading response of a stream with below method.</p>

<pre><code>if (ns.CanRead)
        {
            byte[] readBuffer = new byte[1024];
            int numBytesRead = 0;
            do
            {
                numBytesRead = ns.Read(readBuffer, 0, readBuffer.Length);
                // ss= Encoding.GetEncoding(1252).GetString(readBuffer.ToArray());
                //sb.Append(readBuffer[0].ToString);
                sb.AppendFormat("{0}", Encoding.ASCII.GetString(readBuffer, 0, numBytesRead));
                sb.Replace(Convert.ToChar(24), ' ');
                sb.Replace(Convert.ToChar(255), ' ');
                sb.Replace('?', ' ');
                //sb.Replace(Environment.NewLine, "&lt;br /&gt;").ToString();
            }
            while (ns.DataAvailable);
        }
        // var s = Regex.Replace(sb.ToString(), @"[^\u0000-\u007F]", string.Empty);
        //var s = "&lt;br/&gt;" + sb.ToString();
        //s = s.Normalize(NormalizationForm.FormD);
        //var chars = s.Where(c =&gt; CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark).ToArray();
        //return new string(chars).Normalize(NormalizationForm.FormC);
        ////return "&lt;br/&gt;" + s.ToString();
        var dd = "&lt;br/&gt;" + sb.ToString();
        return dd;
</code></pre>

<p>but string contains the below characters in it. How to remove or replace in order to show the telnet response in readable format in web form? I have tried so many things, but in vain.</p>

<p>I would like to show the response in webpage just like Putty reads the response.</p>

<p>Thanks in advance. </p>

<blockquote>
  <p>;40f;9f;40f;9f;40f;2f;40f;9f[4;34f;9f[4;37f;2f[4;34f;9f[4;34f;11f;40f;9f;40f;9f;40f;11f[4;39f;9f[4;34f;11f[4;37f;9f[4;34f;9f[4;37f;40f[4;34f;40f;9f;40f;11f;40f;11f;40f;9f[4;37f;9f[4;37f;9f[4;37f;11f[4;34f;9f[4;34f;40f[4;34f;40f;11f;40f;11f;40f;11f;40f;9f[4;39f;2f[4;34f;9f[4;37f;9f[4;34f;40f[4;37f;40f;9f;40f;9f;40f;9f;40f;11f[4;37f;9f[4;37f;11f[4;37f;9f[4;34f;40f[4;37f;40f[4;37f;40f;9f;40f;2f;40f;9f[4;37f;9f[4;37f;11f[4;37f;11f[4;39f;9f[4;37f;40f;9f;40f;9f;40f;11f;40f;9f;40f;9f[4;34f;2f[4;34f;9f[4;37f;11f[4;34f;40f[4;37f;40f[4;34f;40f"</p>
</blockquote>