capitalizeWords property

String get capitalizeWords

Capitalizes every word in the string.

Implementation

String get capitalizeWords {
  if (this == null || this!.isEmpty) return '';
  return this!
      .split(' ')
      .map((w) => w.isNotEmpty ? w.capitalize : w)
      .join(' ');
}