StringConversionExtensions extension

String common type conversions extensions

on

Properties

toBool bool

Available on String, provided by the StringConversionExtensions extension

Attempts to convert the string to a boolean value. Supports "true" and "false", case-insensitive.
no setter
toDate DateTime

Available on String, provided by the StringConversionExtensions extension

Attempts to parse the string into a DateTime object. Returns null if the parsing fails.
no setter
toDateTime DateTime

Available on String, provided by the StringConversionExtensions extension

no setter
toDecimal → Decimal

Available on String, provided by the StringConversionExtensions extension

Converts the string to a Decimal. Returns null if the conversion fails. Requires the decimal package.
no setter
toDouble double

Available on String, provided by the StringConversionExtensions extension

Converts the string to a double. Returns null if the conversion fails.
no setter
toDoubleList List<double>

Available on String, provided by the StringConversionExtensions extension

Converts a comma-separated string into a List
no setter
toInt int

Available on String, provided by the StringConversionExtensions extension

Converts the string to an integer. Returns null if the conversion fails.
no setter
toIntList List<int>

Available on String, provided by the StringConversionExtensions extension

Converts a comma-separated string into a List
no setter
toJson → dynamic

Available on String, provided by the StringConversionExtensions extension

Attempts to decode the string as a JSON object. Returns null if decoding fails.
no setter
toList List

Available on String, provided by the StringConversionExtensions extension

Attempts to decode the string as a List
no setter
toNum num

Available on String, provided by the StringConversionExtensions extension

Converts the string to a num (which can be either int or double). Returns null if the conversion fails.
no setter
toUri Uri?

Available on String, provided by the StringConversionExtensions extension

Converts the string to a Uri object. Returns null if the conversion fails or the URL is invalid.
no setter
utc1970 DateTime

Available on String, provided by the StringConversionExtensions extension

Converts the string to a Uri object. Returns null if the conversion fails or the URL is invalid.
no setter