문자열 내에서 특정 위치의 문자를 charAt 메서드를 통해 추출 가능하다.
인자로 뽑아내고 싶은 문자의 위치를를 나타내는 정수형 index를 갖는다.
■ 예시 소스코드
■ 출력
■ 공식 문서
더 세부적으로 알고싶으시다면 Ctrl + F로 원하는 자료를 서칭하시면 좋을 것 같습니다. :)
https://docs.oracle.com/javase/9/docs/api/java/lang/String.html#charAt-int-
String (Java SE 9 & JDK 9 )
Compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicographically to the character sequence represented by the argum
docs.oracle.com
'JAVA' 카테고리의 다른 글
[Java] for each문 - 향상된 for문 (0) | 2024.01.01 |
---|---|
[JAVA] 자바의 진수 변환 (2진수, 8진수, 16진수 --> 10진수) (0) | 2023.03.18 |
[JAVA] 자바의 진수 변환 (10진수 --> 2진수, 8진수, 16진수) (0) | 2023.03.18 |