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()




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA