toNumEither<L> method

Either<L, num> toNumEither<L>(
  1. L onLeft()
)

Convert this String to num, returns the result of onLeft for invalid inputs.

Implementation

Either<L, num> toNumEither<L>(L Function() onLeft) =>
    Either.fromNullable(num.tryParse(this), onLeft);