790d844b51
This extension method complements the existing `toCamelCase` and `toPascalCase` extension methods, allowing a string to be converted from `camelCase` or `PascalCase` to `snake_case`. This extension method will be useful in the analyzer diagnostic message generation logic, which still uses a mix of case styles. Note that there's no need for a separate method to convert to `UPPER_SNAKE_CASE`; that can be easily done by calling `toUpperCase` after `toSnakeCase`. Change-Id: I6a6a69647f4ee176ecdbaefc3de0906a88c69079 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/460206 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Paul Berry <paulberry@google.com>