constantize method

String constantize()

Converts this string to a constant name (UPPER_SNAKE_CASE).

Implementation

String constantize() =>
    toUpperCase().replaceAll(RegExp(r'[^a-zA-Z0-9]'), '_');