The namespace of String.Contain() method is System. Similarly the assembly of String.Contain() method is System.Runtime.dll. Contain() is public built-in method which mean it can be accessible anywhere in code with string class. String.Contain() method is used to checks if a specified substring exists within the string or not if it exist it returns true otherwise it returns false.
In below example, we have string with named str1, str2, str3 which have value Cherry,Ch,ray respectivelly. bool contains1 = str1.Contains(str2); here as str1 string contains the str2 string so it's value is true. bool contains2 = str1.Contains(str3); here as str1 string does not contains the str3 string so it's value is false.