/*
1) Abbreviate Once upon a time >>>Once upon... * */
import org.apache.commons.lang.StringUtils;
public class StringUtilsTrial {
public static void main(String[] args) {
// String can be max 12 chars including the ...
System.out.println("1) Abbreviate Once upon a time >>>"
+ StringUtils.abbreviate("Once upon a time ", 12));
}
}
|