String starts with and ends with : String Search : String C# Examples


C# Examples » String » String Search »

 

String starts with and ends with









    
using  System;  
  
class  MainClass  {  
    public  static  void  Main()  {  
        string  str  =  "abcdefghijk";  

        if(str.StartsWith("abc"))  
            Console.WriteLine("str  begins  with  \"abc\"");  
  
        if(str.EndsWith("ijk"))  
            Console.WriteLine("str  ends  with  \"ijk.\"");  
    }
}
    
   
  
   



Output

str begins with "abc"
str ends with "ijk."


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» String Search