java怎么把字符串最后一个去掉,比如说29.0”,我要把最后那个分号”去掉,怎么去?

如题所述

给你个例子:
public class test {
public static void main(String[] args) {
   String S="29.0”";
   System.out.println(S.substring(0, S.length()-1));
}
}

温馨提示:答案为网友推荐,仅供参考
相似回答