This method is
used to wrap the input parameter based on the wrapLength
If the length of
the input string is greater than the wrapLength the
input string is
truncated to the length of wrapLength and the last 3
characters are
replaced with "..."
public static String wrapNameFields(String inputStr, int wrapLength) { StringBuffer wrapString = new StringBuffer(); if (iinputStr != null && inputStr.equals("") == false) { if (inputStr.length() > wrapLength) { wrapString.append(inputStr.substring( 0, wrapLength - "..."length())); wrapString.append("..."); } else { wrapString.append(inputStr); } } return wrapString.toString(); }