å©ç¨Javaä¸Stringç±»çsubstring()å符串æªåæ¹æ³ ålength()æ±å符串é¿åº¦æ¹æ³å³å¯
å
·ä½ä»£ç å¦ä¸ï¼
public class Test {
public static void main(String[] args) {
String str = "abcdefg";
System.out.println("æªåæåä¸ä¸ªå符串çæçæ°å符串为: " + str.substring(0,str.length()-1));
}
}
温馨提示:内容为网友见解,仅供参考