str.length()
System.out.println(str.length());
str.concat()
String str = new String("hello");
System.out.println(str.concat(" world")); // 출력결과 hello world
System.out.println(str); // 출력결과 hello
String 클래스는 불변 클래스이기 때문에 String 관련 메소드를 사용한다고 해서 본래 저장된 값이 변하지 않는다.
str.substring()
System.out.println(str.substring(1,3)); // 출력결과 el
System.out.println(str.substring(2)); // 출력결과 llo world
str.charAt()
char c = ' ';
c = str.charAt(0);
System.out.println(c); // 출력결과 h