Here you can find the source of left(String source, int length)
public static String left(String source, int length)
//package com.java2s; //License from project: Open Source License public class Main { public static String left(String source, int length) { if (source == null) { return null; }/*from w ww . ja v a 2 s . co m*/ return ((length > source.length()) ? source : source.substring(0, length)); } }