RStringConvert extension

convert string to different types

on

Methods

toChars() List<String>
Convert String to List of Characters
toDate() DateTime
convert String to DateTime if is possible else throw FormatException
toDateOr(DateTime value) DateTime
convert String to DateTime if is possible else will return value
toDateOrNow() DateTime
convert String to DateTime if is possible else will return DateTime Now
toDateOrNull() DateTime?
convert String to DateTime if is possible else will return null
toDouble() double
convert String to double if is possible else throw FormatException
toDoubleOr(double value) double
convert String to double if is possible else will return value
toDoubleOrNull() double?
convert String to double if is possible else will return null
toInt() int
convert String to int if is possible else throw FormatException
toIntOr(int value) int
convert String to int if is possible else will return value
toIntOrNull() int?
convert String to int if is possible else will return null
toNum() num
convert String to num if is possible else throw FormatException
toNumOr(num value) num
convert String to DateTime if is possible else will return value
toNumOrNull() num?
convert String to DateTime if is possible else will return null
toNumOrZero() num
convert String to num if is possible else return 0