Retrieves a substring from this instance.
Syntax
str.Substring(startIndex, length?)Example
Enter values below to update the example in real time.
string→sub→Console→WriteLine→string text = "Hello, World!";
string sub = text.Substring(7, 5);
Console.WriteLine(sub); // "World"