firstWord property

String? firstWord

Get first word of string

Implementation

String? get firstWord {
  if (isNotNullOrEmpty) {
    var words = split(' ');
    if (words.length > 0) {
      return words[0];
    } else {
      return this;
    }
  } else {
    return '';
  }
}