public String limitLen(int maxlen,String string,String suffix){
  String ret=string;
  if (string.length() > maxlen) {
    ret=string.substring(0,maxlen - suffix.length()) + suffix;
  }
  return ret;
}

public String limitLen ( int maxlen , String string , String suffix ) { String ret = string ; if ( string . length ( ) > maxlen ) { ret = string . substring ( 0 , maxlen - suffix . length ( ) ) + suffix ; } return ret ; }
limits ' string ' to ' maxlen ' character . if the string gets curtailed , ' suffix ' is appended to it .
