Dave's Brain

Browse - Programming Tips - Is there an isspace(c) in Java (as in C?)

Date: 2013mar2
Language: Java
Level: Beginner

Q.  Is there an isspace(c) in Java (as in C?)

A.  Yes:

Character.isWhitespace(c);
If you find yourself looping thru a string in C-style its probably better to use a Java Pattern match.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.