code: public static String stripEndingSlash(String string) {
          if (string == null) {
              return null;
          }
          if (string.endsWith("/")) {
              string = string.substring(0, string.length() - 1);
          }
          return string;
      }
docs: Remove ending slash if present and return the string without ending slash
  
  @param string
  @return