truncateToFixedNonWhitespaceLength method
String
truncateToFixedNonWhitespaceLength(
- int length, {
- String truncationIndicator = '…',
- TruncateAt truncateAt = TruncateAt.end,
- String? locale,
Truncates this String as necessary to ensure it contains at most length
non-whitespace characters.
// 'Some text t…'
'Some text that is too long'.truncateToFixedNonWhitespaceLength(10);
See also:
Implementation
String truncateToFixedNonWhitespaceLength(
int length, {
String truncationIndicator = '…',
TruncateAt truncateAt = TruncateAt.end,
String? locale,
}) =>
TruncateToFixedNonWhitespaceLengthTransformation(
length: length,
truncationIndicator: truncationIndicator,
truncateAt: truncateAt,
).transform(this, locale ?? Intl.getCurrentLocale());