String Contains a string : String Contain « String « C# / CSharp Tutorial






using System;  
 
class MainClass {  
  public static void Main() {  
    string str = "abcdefghijk"; 
 
    if(str.Contains("def"))  
      Console.WriteLine("The sequence 'def' was found."); 
 
  }  
}
The sequence 'def' was found.








5.11.String Contain
5.11.1.String Contains a string