toAscii method

String toAscii()

Converts the negative Unicode representation of this String to ASCII.

Example:

'1'.toAscii() == '1'
'−5'.toAscii() == '-5'

Implementation

// ignore: unnecessary_this for improved code formatting.
String toAscii() => this
    .replaceFirst(NumExtension.minusSign, '-')
    .replaceFirst(NumExtension.plusMinusSign, '+');