toTitleCase method

String toTitleCase()

Every word capitalized. "hello big world" → "Hello Big World"

Implementation

String toTitleCase() => split(" ").map((String w) => w.isEmpty ? w : "${w[0].toUpperCase()}${w.substring(1).toLowerCase()}").join(" ");