Use Substring() : String SubString : String C# Examples


C# Examples » String » String SubString »

 

Use Substring()









    
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);  
  
    }  
}
    
   
  
   



Output

str: ABCDEFGHIJKLMNOPQRSTUVWXYZ
str.Substring(0, 15): ABCDEFGHIJKLMNO


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» String SubString