直接截取時,"."字符需要加上轉義字符:
String[] arrPrefix = fileName.split("\\.");
String[] arrPrefix = fileName.split("\\.");
2020-07-06
基本都能看懂,但是個人感覺,這老師確實講得沒前兩季好,這老師敲代碼之前也不講一下這個代碼實現的功能,或者為什么要這么做,就直接把代碼敲出來了,然后運行個結果給你看。讓你自己去猜它的功能
2020-07-03
在eclipse文件夾里找dropins文件,然后加上兩個文件就可以了,最好還是用英文的,英文不懂的話可以上網查,方便理解
2020-06-30
StringBuilder str =new StringBuilder();
str.append("jaewkjldfxmopzdm");
// 從后往前每隔三位插入逗號
int count=0;
for(int i=str.length()-1;i>=0;i--){
count++;
if(count%3==0){
str.insert(i,",");
}
}
System.out.print(str.toString());
str.append("jaewkjldfxmopzdm");
// 從后往前每隔三位插入逗號
int count=0;
for(int i=str.length()-1;i>=0;i--){
count++;
if(count%3==0){
str.insert(i,",");
}
}
System.out.print(str.toString());
2020-06-29
String [] bookName={"高數","英語","Java"};
String [] num={"1001","1002","1003"};
Scanner s=new Scanner(System.in);
System.out.println("請選擇你要借的書名");
String bookName2=s.next( );
try{
}catch(Exception e){
System.out.println("您的輸入有誤請重新輸入");
}
String [] num={"1001","1002","1003"};
Scanner s=new Scanner(System.in);
System.out.println("請選擇你要借的書名");
String bookName2=s.next( );
try{
}catch(Exception e){
System.out.println("您的輸入有誤請重新輸入");
}