The isWhitespace()
function returns true if the character sent as a parameter is whitespace; otherwise, it returns false.
Whitespace includes:
- space
- tab (\t)
- newline (\n)
The following illustration shows a visual representation of the isWhitespace()
function.
boolean isWhitespace(char character)
The isWhitespace()
function takes a character as a parameter.
The isWhitespace()
function returns true if the character sent as a parameter is whitespace and returns false otherwise.
class JAVA {public static void main( String args[] ) {//simple letterSystem.out.println("Character.isWhitespace('E'):");System.out.println(Character.isWhitespace('E'));//tab characterSystem.out.println("Character.isWhitespace('\t'):");System.out.println(Character.isWhitespace('\t'));//space characterSystem.out.println("Character.isWhitespace(' '):");System.out.println(Character.isWhitespace(' '));}}