firstWord property

String? firstWord

input = aditya pratama | output = aditya

Implementation

String? get firstWord {
  if (this == null) return null;
  if (this!.isEmpty) return this;
  return this?.split(' ')[0];
}