Use Substring() 2


   

/*
C#: The Complete Reference 
by Herbert Schildt 

Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/


// Use Substring(). 
  
using System;  
  
public class SubstringDemo {  
  public static void Main() {  
    string str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
 
    Console.WriteLine("str: " + str); 
     
    Console.Write("str.Substring(15): "); 
    string substr = str.Substring(15); 
    Console.WriteLine(substr); 
 
    Console.Write("str.Substring(0, 15): "); 
    substr = str.Substring(0, 15); 
    Console.WriteLine(substr); 
  } 
}
This entry was posted in Data Types. Bookmark the permalink.