How do you check if a string contains a substring in C#?

To check if a string str contains specified substring value , or say if specified substring is present in the string, use C# String. Contains(String) method . Call Contains() method on the string str and pass the substring value as argument. Contains() method returns True if string str contains the substring value .

Sizin İçin Seçtik  What is regex C#?

Leave a Reply

Your email address will not be published. Required fields are marked *