0Pricing
Dart Academy · Lesson

Everyday String Methods

Trim, split, replace, and change case.

Strings Come With Tools

Every Dart string ships with handy methods that transform or inspect text. You call them with a dot after the string.

var s = 'hello';
var n = s.length;

Strings Never Change

String methods return a new string and leave the original untouched. Dart strings are immutable, so always use the returned value.

var s = 'hi';
var loud = s.toUpperCase();

All lessons in this course

  1. String Literals and Quotes
  2. String Interpolation With the Dollar Sign
  3. Multi-line and Raw Strings
  4. Everyday String Methods
← Back to Dart Academy