Here you can find the source of truncateShortMessage(final String message)
public static String truncateShortMessage(final String message)
//package com.java2s; //License from project: Apache License public class Main { static final int MAX_SHORT_MESSAGE_LENGTH = 250; public static String truncateShortMessage(final String message) { if (null == message) { return ""; } else if (message.length() > MAX_SHORT_MESSAGE_LENGTH) { return message.substring(0, MAX_SHORT_MESSAGE_LENGTH); } else {/*from w ww. j av a 2 s.co m*/ return message; } } }