12.1. The System.String Class

Java and C# strings are immutable, and therefore the string instance cannot be modified. Instead, a new instance containing the modification is created whenever a method is called on a string instance that tries to modify it. The .NET Framework class library gives the following class declaration for the System.String class. (If you prefer, you can skip this section and use it as a reference when you start using some of the methods in this class.)

[Serializable]
public sealed class String : IComparable, ICloneable,
IConvertible, IEnumerable

The IComparable interface is similar to the java.lang.Comparable interface. An object implements this interface in order to compare itself to another object of the same type. ...

Get .NET for Java Developers: Migrating to C# 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.