Here you can find the source of chop(String s)
public static String chop(String s)
//package com.java2s; public class Main { public static String chop(String s) { if (s == null) { return (null); }/*w w w . j a v a2s . c om*/ if (s.length() == 1) { return (new String()); } s = s.substring(0, (s.length() - 1)); return (s); } }