/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ee.tlu.htk.dippler.utils; /** * * @author metz */ public class Manipulators { public static String textSubString(String text, int start, int end) { // strip html tags text = text.replaceAll("\\<.*?>",""); String str = ""; int limit = 0; int textlength = text.length(); if (textlength <= end) { return text; } limit = end; if(text.length() > 0 && !text.equalsIgnoreCase("")) { String substr = text.substring(end, end+1); if(!substr.equalsIgnoreCase("")) { while(!substr.equals("") && limit < textlength) { substr = text.substring(limit, ++limit); substr = substr.trim(); } } str = text.substring(start, limit); } return str+"..."; } }