Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,895 questions

51,826 answers

573 users

How to convert a string to ASCII Encoding in C#

1 Answer

0 votes

using System;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = "ASCII Encoding in C#";

            byte[] ascii = Encoding.ASCII.GetBytes(s);
            foreach (byte b in ascii)
                Console.Write(b + " "); 
        }
    }
}

/*
run:
  
65 83 67 73 73 32 69 110 99 111 100 105 110 103 32 105 110 32 67 35
 
*/


answered Feb 22, 2015 by avibootz

Related questions

1 answer 135 views
135 views asked Jan 27, 2024 by avibootz
1 answer 283 views
1 answer 173 views
1 answer 113 views
113 views asked Apr 2, 2021 by avibootz
...