Strings and Characters - CSharp Language Basics

CSharp examples for Language Basics:string

Introduction

C#'s char type (aliasing the System.Char type) represents a Unicode character and occupies 2 bytes.

A char literal is specified inside single quotes:

Demo Code

using System;/*www.ja v  a2s  .c  om*/
class Test
{
   static void Main(){
      char c = 'A';       // Simple character
      Console.WriteLine (c);
   }
}

Result


Related Tutorials