Here you can find the source of Truncate(String v, int length)
public static String Truncate(String v, int length)
//package com.java2s; //License from project: Open Source License public class Main { public static String Truncate(String v, int length) { return v.substring(0, Math.min(v.length(), length)); }/*w w w . ja va 2s . c om*/ }