C# String.Substring Method

Substring (int startIndex) - 하는 위치부터 끝까지 

string s = "0123456789";
Console.WriteLine(s.substring(5));

// 결과 "56789"


Console.WriteLine(s.substring(7));

// 결과 "789"


Substring (int startIndex, int length) - 원하는 위치부터 문자 개수


Console.WriteLine(s.substring(5,2)); // 문자열 인덱스 5부터 2개의 문자를 반환

// 결과 "56"