Use Substring() 1

image_pdfimage_print

   

/*
C#: The Complete Reference 
by Herbert Schildt 

Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/
// Use Substring(). 
 
using System; 
 
public class SubStr {  
  public static void Main() {  
    string orgstr = "C# makes strings easy."; 
 
    // construct a substring 
    string substr = orgstr.Substring(5, 12); 
     
    Console.WriteLine("orgstr: " + orgstr); 
    Console.WriteLine("substr: " + substr); 
 
  }  
}


           
          


This entry was posted in Data Types. Bookmark the permalink.