Java Character isWhitespace() MethodThe isWhitespace(char ch) method of Character class determines whether the given character(Unicode code point) is a whitespace character or not. A character in Java can be considered as a whitespace character if one of the following criteria is satisfied:
SyntaxParameterThe above method requires only one parameter: a.)The character that needs to be tested. Return ValueThe isWhitespace(char ch) method returns a Boolean value, i.e., true if the given(or specified) character is a Java white space character. Otherwise, this method returns false. Example 1Output: The first character is a white space character :true The second character is a white space character :false The third character is a white space character :false Example 2Output: The first character is a white space character :true The second character is a white space character :true The third character is a white space character :false Java Character isWhitespace() MethodThe isWhitespace(int codePoint) method of Character class determines whether the given(or specified) character is a whitespace character or not. A character in Java can be considered as a whitespace character if one of the following criteria is satisfied:
SyntaxParameterThe above method requires only one parameter: a.)The codePoint which is the character that needs to be tested. Return ValueThe isWhitespace(int codePoint) method returns a Boolean value, i.e., true if the given(or specified) character is a Java whitespace character. Otherwise, this method returns false. Example 1Output: The codePoint '49' is not a whitespace character. The codePoint '121' is not a whitespace character. The codePoint '234' is not a whitespace character. Example 2Output: The codepoint '9' is a whitespace character. The codepoint '10' is a whitespace character. The codepoint '13' is a whitespace character. Example 3Output: The first codePoint '9' is a Java space character:true The first codePoint '121' is a Java space character:false The first codePoint '245' is a Java space character:false Next TopicJava-character-lowsurrogate-method |