Hello,
Here is simple explanation of Substring functionality.
Substring:- The Substring method is an instance method on the string class, which means you must have a non-null string to use it without triggering an exception. This program will extract the first three characters into a new string reference, which is separately allocated on the managed heap.
Here is the simple code.
using System;
class Program
{
static void Main()
{
string input = "OneTwoThree";
// Get first three characters
string sub = input.Substring(0, 3);
Console.WriteLine("Substring: {0}", sub);
}
}
Now in your case you are starring with
5th position till 4th character.
So you will get an output of four letters starting from 5th letter.
It will start from 0th position.