Here you can find the source of substr(StringBuffer buf)
public static Object substr(StringBuffer buf)
//package com.java2s; //License from project: Open Source License public class Main { public static Object substr(StringBuffer buf) { return (buf == null || buf.length() <= 1 ? "" : buf.substring(0, buf.length() - 1)); }/*from www. j av a 2s . c o m*/ }