String str = "123456789";
String subStr = str.substring(0, str.length() -3);
这个是可执行的源码,希望你能看得懂。
public static void main(String[] args) {
final String str = "12345789";
seperateString(str,3);
}
public static void seperateString(String str, int endLength) {
if (str == null || str.length() < endLength) {
System.out.println("string length should be more than "+endLength);
return;
}
final int seperateIndex = str.length() - endLength;
String firstStrPart = str.substring(0, seperateIndex);
String endStrPart = str.substring(seperateIndex);
System.out.println(firstStrPart + "," + endStrPart);
}
public class Test {
public static void main(String[] args) {
String num1 = "123456789";
String num2 = "123456";
System.out.println(num1.substring(0,6));
System.out.println(num2.substring(0,3));
}
}
Scanner scan=new Scanner(System.in);
String a=scan.nextLine();
System.out.println(a.substring(0, a.length()-3));
327926493,您好!
看全集高清还是到 《 天齐电影网 》百度一下就知道
更新超级快,有时比电影院和电视都快呀。
边看边下载的,一点也不卡的说。(*^__^*) 嘻嘻……