Here you can find the source of chop(String x)
public static String chop(String x)
//package com.java2s; public class Main { public static String chop(String x) { if (x.length() == 0) return x; return x.substring(0, x.length() - 1); }/*from ww w .ja va 2 s . c o m*/ }