Code/JAVA4 [JAVA] VSCode - Build failed, do you want to continue? 더보기 빌드 실패팝업 무시하고 실행하는 방법 [Ctrl + , ]로 설정 진입하기 (맥은 cmd+, ) 확장 java Debugger Force build before Launch 체크하기 2022. 11. 6. [JAVA]split() 더보기 split() String[] temp = str.split("\t"); //특정 문자를 기준으로 문자열을 나눈다. // "temp=SUNDAYMONDAY" 일 경우 // temp[0]=SUNDAY, temp[1]=MONDAY 2022. 11. 6. [JAVA]nextLine(), hasNextLine() 더보기 hasNextLine(); while(scan.hasNextLine()) { String str = scan.nextLine(); //스캐너 객체가 읽을 다음줄이 존재하는가에 대한 Boolean 값 더보기 nextLine(); while(scan.hasNextLine()) { String str = scan.nextLine(); String[] temp = str.split("\t"); //scaner 객체의 내용을 '줄' 단위로 가져온다. //위의 코드는 읽을 '줄'이 사라질 때까지 str에 각 줄의 내용을 대입 2022. 11. 6. [JAVA]문자열 앞뒤의 공백을 제거하기 더보기 1.trim() String str = " Hello "; Strint trimstr = str.trim(); System.out.println(trimstr); //실행결과 Hello 더보기 2.strip() String str = " Hello "; Strint stripstr = str.strip(); System.out.println(stripstr); //실행결과 Hello 2022. 11. 6. 이전 1 다음