Sunday, February 14, 2010

whitespace

http://www.java2s.com/Tutorial/Java/0040__Data-Type/isWhitespace.htm

isWhitespace():true if the argument is whitespace.

which is any one of the following characters:

space (' '), tab ('\t'), newline ('\n'), carriage return ('\r'),form feed ('\f')

public class MainClass {
public static void main(String[] args) {
char symbol = 'A';

if (Character.isWhitespace(symbol)) {
System.out.println("true");
}else{
System.out.println("false");
}
}
}

No comments:

Post a Comment