Here you can find the source of ellipsizeString(String string, int limit)
public static String ellipsizeString(String string, int limit)
//package com.java2s; public class Main { public static String ellipsizeString(String string, int limit) { String retValue = ""; if (string != null) { if (string.length() > limit) { retValue = string.substring(0, limit) + "..."; } else { retValue = string;/*from w w w .ja va2s . c om*/ } } return retValue; } }