O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

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

Commonly Used String Methods

Throughout this exploration of the framework’s rich functionality to deal with text, we have barely spoken about the type it’s all about: System.String. Let’s spend a minute or two pinpointing a few useful methods of this class.

Note: Strings Are Character Sequences

And because sequences are implemented using the IEnumerable<T> interface, guess what? The whole set of query operators defined over IEnumerable<T>, here with T substituted for char, shows up in the IntelliSense on a string object. This can be perceived as annoying at times. In fact, prior to Visual Studio 2010, for some reason I don’t understand, IntelliSense on string objects never showed the extension methods.

Obviously, this behavior can be suppressed ...

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