package com.test;
public class StringStudy {
public static void main(String[] args) {
//"안녕하세요"는 CharSequence char='b'
//String a="안녕하세요";//오토박싱
//String 은 스트링 class
String a="안녕하세요";
String b="ABCDEFG";
String c="abcdefg";
int x=10;
int length=a.length();
System.out.println("length= "+length);
boolean equals=b.equals(c);
System.out.println("equals= "+equals);
//case 문자, UpperCase 대문자, LowerCase 소문자
boolean equalsIgnore = b.equalsIgnoreCase(c);
System.out.println("equalsIgnore= "+equalsIgnore);
// 0 1 2 3 4
String subString = a.substring(3);// 안 녕 하 세 요
System.out.println("subString= "+subString);
subString = a.substring(2,4);
System.out.println("subString= "+subString);
System.out.println(a.concat(b));//concat-붙이다.
System.out.println(a.replace('녕','용'));
System.out.println(b.toLowerCase());
System.out.println(c.toUpperCase());
System.out.println(c.charAt(0));
System.out.println(c.indexOf(0));//0의 위치는?
System.out.println(a.indexOf("하"));//"하"의 위치는?
System.out.println(a.lastIndexOf(5));//아스키코드
String d=" 안녕 ";
System.out.println(d);
System.out.println(d.trim());
int k=5555;
System.out.println( String.valueOf(k));
}
}