O'Reilly logo

Pro C# 2010 and the .NET 4 Platform, Fifth Edition by Andrew Troelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3.5. Working with String Data

System.String provides a number of methods you would expect from such a utility class, including methods that return the length of the character data, find substrings within the current string, and convert to and from uppercase/lowercase. Table 3-5 lists some (but by no means all) of the interesting members.

Table 3.5. Select Members of System.String
String MemberMeaning in Life
LengthThis property returns the length of the current string.
Compare()This static method compares two strings.
Contains()This method determines whether a string contains a specific substring.
Equals()This method tests whether two string objects contain identical character data.
Format()This static method formats a string using other primitives ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required