I have a text file and each of its line is like that
author-title-kind
I have a Java program parsing this file and it must returns only the books whose author is "example"
.
I read a line at a time, and then I split the string with StringTokeneizer
or split()
.
So I will get 3 items: author, title, kind
.
Then I check if the first item string is equal to "example".
The problem is that I always get false, and never true.
Is there any hidden character so that this comparison ends always with false?
Maybe I should check with "example-"
, or "-example"
...or anything else?