删除字符串最后一个字符 @Test public void test(){ String s="CCY|CCY|"; System.out.println(s.substring(0, s.length()-1)); }