일상코더 2022. 9. 27. 20:47
public char charAt(int index)//@Range(from = 0, to = java.lang.integer.MAX_VALUE) 0~2147483647 {
    if (isLatin1()) {
        return StringLatin1.charAt(value, index);
    } else {
        return StringUTF16.charAt(value, 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.

Params: 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.

 

 

지정된 인덱스의 char 값을 반환합니다. 
인덱스 범위는 0에서 length() - 1까지입니다.
시퀀스의 첫 번째 char 값은 인덱스 0에 있고 다음은 인덱스 1에 있는 식입니다.
배열 인덱싱에 관해서 인덱스에 의해 지정된 char 값이 대리인 경우, 대리 값이 반환됩니다.

파라미터 : 인덱스 - char 값에 대한 인덱스
리턴값 : 문자열의 특정 인덱스에 있는 char 값, 첫번째 char 값은 인덱스 0부터 시작함