C# Lesson 8

Matt Bauer 2/3/2020

Characters, the data type that's just a little less useful than a string.

The while statement is simple loop. As long as the condition inside the while() evaluates to true, the section of code will keep repeating itself.


using System;

namespace Lesson8
{
    class Characters
    {
        static void Main(string[] args)
        {
            // b
            // 2
            // !
            // Ñ

            Console.OutputEncoding = System.Text.Encoding.UTF8;// Add this last

            char myFirstChar = 'Ñ';
            Console.WriteLine("Char: " + myFirstChar + " | Int: " + Convert.ToInt32(myFirstChar));

            for (int x = 1; x <= 209; x++)
            {
                char numberToChar = Convert.ToChar(x);
                Console.WriteLine($"count {x} : {numberToChar}"); // Show ascii/unicode table after this
            }

        }
    }
}


/*
* TASK:
*   Make a for loop that starts at 97 and goes to 122 (includes 122).
*   Convert the integer you use for the for loop into a char and print it. 
*   It will print a lowercase letter.
*   Then print the same letter but in uppercase in the same loop.
*   
*   You can use https://en.wikipedia.org/wiki/List_of_Unicode_characters as a reference.
*/

using System;

namespace Lesson8Task
{
    class CharactersTask
    {
        static void Main(string[] args)
        {
        }
    }
}