Csharp/CSharp Tutorial/String/String Contain

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

String Contains a string

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.