The contains method of String In C# The string Contains method is used to check whether the specified substring exists in the given string or not and it will return a boolean value. In case, if a substring exists in a string , then the contains method will return true otherwise it will return false . Contains Method Syntax The following is the syntax for defining a Contains method to check whether the substring exists in a given string or not. public bool Contains( string value) From the syntax above, the Contains method will check whether the substring value exists or not and it will return a boolean value. Contains Method Example in C# Following is the example of using Contains() method to check whether the given value (substring) occurs within the string or not. using...
Csharp Naija is a blog that teaches C# programming using a practical guide. C# Nigeria is here to guide interested individual to the world of software Engineering.