code: private String truncateAt(final String input, final String searchString) {
          final int i = input.indexOf(searchString);
          if (i != -1) {
              return input.substring(0, i);
          }
          return input;
      }
docs: Truncate the input string after the first occurrence of the
  searchString.
  
  @param input the source string
  @param searchString the string to look for in the source
  @return the truncated string