File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Is tab a character? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Is tab a character?" Watch "Is tab a character?" New topic

Is tab a character?

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Hi I am confounded by a String problem. I have this parser that is supposed to skip either spaces or null characters, but I got this one mysterious token that returns false for comparison with both null and space! And when I tried to println that token, it's blank. So, that left me to wonder if tab is considered a character that can be compared.
Please help.
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Yeah, tab is a character. Lacking oxygen is a terrible thing.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Yup, its the character '\t'
[This message has been edited by David O'Meara (edited May 08, 2001).]
Art Metzer
Ranch Hand

Joined: Oct 31, 2000
Posts: 241
Hi, Cameron.
Are you sure you're using the "equals" comparator for the space?
If "candidate" is a String, then...

I agree. Here's the link:
subject: Is tab a character?
It's not a secret anymore!