lowerChar function

String lowerChar(
  1. String str
)

Implementation

String lowerChar(String str) {
  var _tmp = str.replaceAllMapped(RegExp("[A-Z]"), (match) {
    return '_${match.group(0)?.toLowerCase()}';
  });
  return _tmp.startsWith('_') ? _tmp.substring(1) : _tmp;
}