removeSuffixAndCamel method

String removeSuffixAndCamel(
  1. String value,
  2. String suffix
)

Implementation

String removeSuffixAndCamel(String value, String suffix) {
  if(!value.endsWith(suffix)) {
    throw AFException("Expected $value to end with $suffix");
  }
  final prefix = value.substring(0, value.length-suffix.length);
  return toCamelCase(prefix);
}