Method
Substring returns part of the text from the specified position and length in the C#.
Method
Substring declared in the classroom
String
C#
string str1 = "Hello World!";
string str2 = str1.Substring(2, 5);
// str1 = "Hello World!"
// str2 = "llo W"
C#
string str1 = "Hello World!";
string str2 = str1.Substring(2);
// str1 = "Hello World!"
// str2 = "llo World!"