if (results.length() == 0) { return ""; } else { return results.substring(0, results.length() - 1); }
等价于
return (results.length()>0)?(results.substring(0, results.length() - 1)):"";