class Substring {

  @Udf(description = "Returns a substring of str from pos to the end of str")
  public String substring(
      @UdfParameter(description = "The source string.") final String str,
      @UdfParameter(description = "The base-one position to start from.") final Integer pos
  ) {
    if (str == null || pos == null) {
      return null;
    }
    final int start = getStartIndex(str, pos);
    return str.substring(start);
  }

}