Javatpoint Logo
Javatpoint Logo

C# String Contains()

The C# Contains() method is used to return a value indicating whether the specified substring occurs within this string or not. If the specified substring is found in this string, it returns true otherwise false.

Signature

Parameters

str: it is a string object which is used to check occurrence in the calling string.

Return

It returns boolean value either true or false.


C# String Contains() method Example

Output:

True
False
Next TopicC# String Copy()





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA