Here you can find the source of left(String text, int max)
public static String left(String text, int max)
//package com.java2s; //License from project: Apache License public class Main { public static String left(String text, int max) { if (text.length() <= max) return text; return text.substring(0, max - 3) + "..."; }/*from ww w .j a v a 2 s . com*/ }