Get bytes or chars (C#) : Encoding « Development « ASP.NET Tutorial






<%@ Page %>
<script language="C#" runat="server">
  private void Page_Load(object sender, System.EventArgs e)
  {
    int i;
    Byte[] myBytes = System.Text.Encoding.ASCII.GetBytes("Hello World");
    for (i=0;i<myBytes.Length;i++)
    {
      Response.Write(myBytes[i].ToString() + " ");
    }
    char[] myChars=System.Text.Encoding.ASCII.GetChars(myBytes);
    string myString=new string(myChars);
    Response.Write("<BR>" + myString);
    
  }
</script>
<html>
  <body>
    <form id="form1" method="post" runat="server">
    </form>
  </body>
</html>








9.15.Encoding
9.15.1.Get bytes or chars (C#)
9.15.2.Get bytes or chars (VB)