StringTruncateMiddleExtensions extension

Truncate the middle of a string, keeping both ends visible.

on

Methods

truncateMiddle(int? maxLength, {String ellipsis = '…'}) String

Available on String, provided by the StringTruncateMiddleExtensions extension

Returns this string shortened to maxLength by replacing the middle with ellipsis, keeping the start and end visible.