removeTrailingSlash function

String removeTrailingSlash(
  1. String path
)

Removes a trailing slash from the path if it has one.

Implementation

String removeTrailingSlash(String path) {
  if (path.endsWith(kPathSeparator)) {
    return path.substring(0, path.length - 1);
  }
  return path;
}