Working with Strings

Let's get started and see how you can work with strings. We recommend going through this section carefully so that you can use this information in the chapters that are still to come.

Working with strings is so important that we decided to present an example for every method related to your daily work with strings. Understanding these examples is essential for understanding the rest of the book.

Comparing Strings

To compare two strings with each other, C# provides two methods. The Compare method is a static method that accepts two values. In contrast to Compare, the CompareTo method is called for an instance. This is a major difference, although the output of those two methods is the same.

Let's look at an example and see ...

Get Mono Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.