Here you can find the source of safeCutNoDot(String str, int length)
static String safeCutNoDot(String str, int length)
//package com.java2s; public class Main { static String safeCutNoDot(String str, int length) { if (str.length() > length) { return str.substring(0, length); }//from ww w. j a v a2s . c om return str; } }