Suppose I have a utility function like this –
public static boolean isABlankSpace(char c)
{
// returns true if the char c is rendered as a blank space
}
My current implementation only does-
if(c == ' ')
{
return true;
}
But I realize that many other ASCII codes could be rendered as blanks. So which are these ASCII codes? And how would that change my implementation?
You could use:
which is a built in utility method. Details of what it does is in the javadoc. Note that it will return true for line breaks (
\n,\retc.) too.