Languages
[Edit]
EN

C# / .NET - find text in string

0 points
Created by:
Elleanor-Williamson
380

In this article, we would like to show you how to find text in string in C# / .NET.

Quick solution

Edit

or

 

Practical examples

Edit

1. String.Contains()

Edit

In this example, we use String.Contains() method to check if the string contains text.

Output:

2. String.indexOf()

Edit

In this example, we use String.IndexOf() method to find the index of the first occurrence of text in the string.

Output:

References

Edit

Alternative titles

  1. C# / .NET - how to find text in string?
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Cross technology - find text in string

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join