Use Substring() : String SubString « String « C# / CSharp Tutorial






using System;  
  
class MainClass {  
  public static void Main() {  
    string str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
 
    Console.WriteLine("str: " + str); 
     
    Console.Write("str.Substring(0, 15): "); 
    string substr = str.Substring(0, 15); 
    Console.WriteLine(substr); 
 
  } 
}
str: ABCDEFGHIJKLMNOPQRSTUVWXYZ
str.Substring(0, 15): ABCDEFGHIJKLMNO








5.6.String SubString
5.6.1.String Substring(int index)
5.6.2.Use Substring()