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#

  1. 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.
  2. String Interpolation (Novice): Build strings by putting values straight into the text with quot;...{value}...", and format numbers, money and columns as you go.
  3. 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.
  4. 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

  1. 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.