int java.lang.Integer.parseInt(String s)

송병훈·2022년 3월 21일
0

method

목록 보기
3/13

int java.lang.Integer.parseInt(String s) throws NumberFormatException


문자열을 정수로 해석합니다. 문자열의 문자는 모두 10진수여야 합니다. 단, 첫 번째 문자는 음의 값을 나타내는 ASCII 마이너스 기호 '-'(\u005Cu002D) 또는 양의 값을 나타내는 ASCII 플러스 기호 '+'(\u005Cu002B)일 수 있습니다. 인수와 기수 10이 parseInt(java.lang.String, int) 메서드에 인수로 지정된 것과 동일하게 결과 정수 값이 반환됩니다.

파라미터:
구문 분석할 int 표현을 포함하는 문자열

반환값:
인수로 표시되는 10진수 정수 값.

예외:
NumberFormatException - 문자열에 구문 분석 가능한 정수가 포함되지 않은 경우.


Parses the string argument as a signed decimal integer. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' ('\u005Cu002D') to indicate a negative value or an ASCII plus sign '+' ('\u005Cu002B') to indicate a positive value. The resulting integer value is returned, exactly as if the argument and the radix 10 were given as arguments to the parseInt(java.lang.String, int) method.

Parameters:
s a String containing the int representation to be parsed

Returns:
the integer value represented by the argument in decimal.

Throws:
NumberFormatException - if the string does not contain a parsable integer.

profile
성실하고 꼼꼼하게

0개의 댓글