String Contains String - CSharp Language Basics

CSharp examples for Language Basics:string

Description

String Contains String

Demo Code

using System;/*from w ww  .ja  va 2 s.  c  o m*/
class MainClass {
   static void Main(string[] args) {
      string str = "This is test";
      if (str.Contains("test")) {
         Console.WriteLine("The sequence 'test' was found.");
      }
   }
}

Result


Related Tutorials