Here you can find the source of left(Object src, int length, String defaultValue)
public static String left(Object src, int length, String defaultValue)
//package com.java2s; public class Main { public static String left(Object src, int length, String defaultValue) { if (src != null) { String temp = src.toString(); if (temp.length() >= length) { return temp.substring(0, length); }// ww w . j a v a 2 s . c o m return temp; } return defaultValue; } }