.charAt() 메소드

C9·2022년 9월 22일
0

.charAt()

  • String으로 저장된 문자열 중에서 한 글자만 선택해서 char타입으로 변환해준다.
String str = new String();

char c = ' ';

str = "안녕하세요";

c = str.charAt(0);

System.out.println(c); //결과값 : '안'
profile
Hello

0개의 댓글