String.Substring()
- The "Substring()" method takes either one or two integer arguments and returns a substring from a larger existing string. Strings in C# are represented as 0 index collections of characters. The first argument represents the starting index of the substring. The second argument represents the ending index. If the programmer provides only one argument, the method will return a substring from the argument's index through the end of the string. The following example details the Substring method.
string ex = "This is a String";
string sub = ex.Substring(10); //"String"
string sub2 = ex.Substring(0, 6); //"This is"