String클래스1 [JAVA] 자주쓰는 String 클래스 메소드(String Class method) 자주쓰는 String 클래스의 메소드들에 대해 알아봅니다. startsWith 메소드 문자열이 지정한 문자로 시작하는지 판단한다. 같으면 true, 아니면 false를 리턴한다. String test ="test"; System.out.println("startsWith : " + test.startsWith("t")); //startsWith : true String 클래스의 startsWith 메소드 public boolean startsWith(String prefix, int toffset) { // Note: toffset might be near -1>>>1. if (toffset length() - prefix.length()) { return false; } .. 2022. 3. 20. 이전 1 다음