자바 20

문자열 찾기

package ch05.sec05;public class IndexOfContainsExample { public static void main(String[] args) { String subject="자바 프로그래밍"; int location=subject.indexOf("프");//해당 문자열 인덱스 값을 찾을 때 (왼쪽부터) //int location=subject.indexOf("프프");//찾으면 인덱스값을 리턴. 그렇지 않으면 -1값 리턴. System.out.println(subject.lastIndexOf("프"));//(오른쪽부터) System.out.println(location); boolean result =subject.contains("자 바");//해..