char java.lang.String.charAt(int index)

송병훈·2022년 3월 21일
0

method

목록 보기
4/13

char java.lang.String.charAt(int index)


지정된 인덱스의 char 값을 반환합니다.인덱스의 범위는 0 ~ length() - 1 입니다. 배열 인덱싱과 같이 시퀀스의 첫 번째 문자 값은 인덱스 0, 다음 문자 값은 인덱스 1입니다.

인덱스로 지정된 char 값이 대리일 경우 대리 값이 반환됩니다.

지정자:
CharSequence의 charAt(...)

파라미터:
char 값의 인덱스를 인덱싱합니다.

반환값:
이 문자열의 지정된 인덱스에 있는 char 값을 반환합니다. 첫 번째 문자 값은 인덱스0 입니다

예외:
IndexOutOfBoundsException - index 인수가 음수이거나 이 문자열 길이 이상인 경우.


Returns the char value at the specified index. An index ranges from 0 to length() - 1. The first char value of the sequence is at index 0, the next at index 1, and so on, as for array indexing.

If the char value specified by the index is a surrogate, the surrogate value is returned.

Specified by: charAt(...) in CharSequence

Parameters:
index the index of the char value.

Returns:
the char value at the specified index of this string. The first char value is at index 0.

Throws:
IndexOutOfBoundsException - if the index argument is negative or not less than the length of this string.

profile
성실하고 꼼꼼하게

0개의 댓글