initials method

String initials()

Returns the initials of the string.

Implementation

String initials() {
  return split(' ')
      .where((word) => word.isNotEmpty)
      .map((word) => word[0].toUpperCase())
      .join('');
}