abbreviate static method
Methods that deal with parts of a string.
Abbreviate a string to maxWidth by truncating the
string and adding '...' to the truncated string.
If string is null an empty string is returned.
Strings.abbreviate('Hello World', 6) == 'Hel...'
The minimum string for maxWidth is 4
Implementation
/// Abbreviate a string to [maxWidth] by truncating the
/// string and adding '...' to the truncated string.
///
/// If [string] is null an empty string is returned.
/// ```
/// Strings.abbreviate('Hello World', 6) == 'Hel...'
/// ```
/// The minimum string for [maxWidth] is 4
static String abbreviate(String? string, int maxWidth, {int offset = 0}) =>
Part.abbreviate(string, maxWidth);