Strings in C#
Almost every program works with text. You will learn how C# strings behave, build text with string interpolation, and use the string methods you will reach for every day.
Updated
Strings in C#
- Understanding the String Class (Novice): A C# string is a read-only sequence of characters; read them by index, write special characters with escape sequences, and understand why strings never change.
- String Interpolation (Novice): Build strings by putting values straight into the text with
quot;...{value}...", and format numbers, money and columns as you go. - Useful String Methods (Apprentice): Find text with IndexOf, LastIndexOf, Contains, StartsWith and EndsWith, and cut and reshape it with Substring, Split, ToUpper, ToLower, Trim and Replace.
- Common String Tasks (Apprentice): Combine string methods to do everyday jobs, cleaning up input, reformatting names and phone numbers, padding, reversing and building long strings.
Exercise: Strings
- Exercise: Strings (Apprentice): Build HTML and XML from strings, format and rearrange people's names, and try seven bonus word problems, with tests that check each method.