segment static method

String segment(
  1. String s
)

Implementation

static String segment(String s) {
  var out = CaseStyle.snakeCase.transform(s);
  return out.endsWith('_api') ? out.substring(0, out.length - 4) : out;
}