removeGroup function

String removeGroup(
  1. String path
)

Implementation

String removeGroup(String path) {
  return path
      .replaceAll(RegExp(r'\([\d\w_]+\)'), '')
      .replaceAll(RegExp(r'/+'), '/')
      .replaceAllMapped(RegExp(r'^(.+)/$'), (m) => m[1].toString());
}