Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Last character in a string in C#

The code below is used to find the last character of the string.

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            string nameFull = "code";

            string LastChar = nameFull.Substring(nameFull.Length - 1, 1);

            Console.WriteLine("Last character :" + LastChar);
                        
        }

    }
}


Output: e