MiscOnStringExtension extension

on

Methods

replaceLast(Pattern from, String to, [int startIndex = 0]) String

Available on String, provided by the MiscOnStringExtension extension

Replaces the last occurrence of from with to starting at startIndex.
splitByLastOccurrenceOf(String separator) List<String>

Available on String, provided by the MiscOnStringExtension extension

toUriOrNull() Uri?

Available on String, provided by the MiscOnStringExtension extension

Converts the string to a Uri or returns null if the string is not a valid URI.
truncToLength(int length) String

Available on String, provided by the MiscOnStringExtension extension

Truncates the string to the given length and adds '...' at the end.
withNormalizedWhitespace() String

Available on String, provided by the MiscOnStringExtension extension

Replaces all whitespace characters with a single space.