wherehows-dao/src/main/java/wherehows/util/UrnUtil.java
public static String trimToLength(String s, int maxLength) {
    if (s == null) {
      return null;
    }

    return s.substring(0, Math.min(s.length(), maxLength));
  }
/**
   * Trim string to be at most 'maxLength' characters, if less, return the original string.
   * @param s String
   * @param maxLength int
   * @return trimmed String
   */
Trim string to be at most 'maxLength' characters, if less, return the original string.
@param s String
@param maxLength int
@return trimmed String
Trim string to be at most ' maxLength ' characters if less return the original string . @param s String @param maxLength int @return trimmed String
public static String trimToLength(String s, int maxLength) {
    if (s == null) {
      return null;
    }
    return s.substring(0, Math.min(s.length(), maxLength));
  }
public static String trimToLength ( String s , int maxLength ) { if ( s == null ) { return null ; } return s . substring ( 0 , Math . min ( s . length ( ) , maxLength ) ) ; }
Trim string to be at most 'maxLength' characters, if less, return the original string.
Trim string to be at most ' maxLength ' characters if less return the original string .