initials method
Uppercase initial letters (up to max words), useful for avatars.
Implementation
String initials({int max = 2}) {
final words = _wordParts(this);
if (words.isEmpty) return '';
if (words.length == 1) {
final w = words.first;
return w.substring(0, w.length < max ? w.length : max).toUpperCase();
}
return words.take(max).map((w) => w[0].toUpperCase()).join();
}