StringUtility extension
Utility for Strings.
- on
Properties
- nullIfWhitespace → String?
-
Returns null if this string is whitespace.
no setter
Methods
-
extractJson(
[String separator = '']) → Map< String, dynamic> ? - Extract and decode json from a string
-
parseDateTime(
) → DateTime -
parseViewCount(
) → int? - Parse view count from a string formatted as an integer and its magnitude. Example: 5 views, 1.5K views, 2.3M views, 3.4B views. If this fails returns null.
-
stripNonDigits(
) → String - Strips out all non digit characters.
-
substringAfter(
String separator) → String -
substringUntil(
String separator) → String - Returns null if this string is a whitespace.
-
toDuration(
) → Duration? - Format: HH:MM:SS