How to convert int to ASCII char in C#

3 Answers

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            char ch = Convert.ToChar(97);

            Console.WriteLine(ch);
        }
    }
}


/*
run:

a

*/

 



answered Mar 3, 2017 by avibootz
0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            char ch = (char)97;

            Console.WriteLine(ch);
        }
    }
}


/*
run:

a

*/

 



answered Mar 3, 2017 by avibootz
0 votes
using System;
using System.Text;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Encoding.ASCII.GetString(new byte[] { 97 });

            Console.WriteLine(s);
        }
    }
}


/*
run:

a

*/

 



answered Mar 3, 2017 by avibootz

Related questions

1 answer 184 views
184 views asked Nov 28, 2019 by avibootz
1 answer 159 views
159 views asked Nov 28, 2019 by avibootz
1 answer 194 views
1 answer 235 views
1 answer 272 views
272 views asked Jun 13, 2017 by avibootz
1 answer 121 views
121 views asked May 7, 2022 by avibootz
1 answer 140 views
...