toNum method

num? toNum()

Converts the String to an Number.

Example:

print("123".toNum()); // 123

Implementation

num? toNum() => isNotEmptyOrNull ? num.tryParse(this!) : null;