StringMunipulator extension

on

Properties

getUniqueId String
Generates a unique ID. If prefix is given, the ID is appended to it. Example: "hello" -> "hello" -> "hello"
no setter
toDeburr String
Deburrs string by converting Latin-1 Supplement and Latin Extended-A letters to basic Latin letters and removing combining diacritical marks.
no setter

Methods

toRepeat(int n) String
Repeats the given string n times. Example: "hello" -> "hellohello"
toReplace(RegExp pattern, String replacement) String
Replaces matches for pattern in string with replacement. Example: "hello" -> "hello" -> "hello"
toTruncate(int length, [String? omission]) String
Truncates string if it's longer than the given maximum string length. The last characters of the truncated string are replaced with the omission string which defaults to "...". Example: "hello" -> "hello" -> "hello"