firstWord method
Returns the first word of this string, or null if empty.
Audited: 2026-06-12 11:26 EDT
Implementation
@useResult
String? firstWord() {
if (isEmpty) {
return null;
}
return words()?.firstOrNull;
}
Returns the first word of this string, or null if empty.
Audited: 2026-06-12 11:26 EDT
@useResult
String? firstWord() {
if (isEmpty) {
return null;
}
return words()?.firstOrNull;
}