aspose file tools*
The moose likes Beginning Java and the fly likes problem comparing strings... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem comparing strings..." Watch "problem comparing strings..." New topic
Author

problem comparing strings...

Colleen Lynch
Greenhorn

Joined: Jun 18, 2001
Posts: 15
I am doing a simple comparison that isn't giving the result I think it should:
<code>
String type = chartBean.getChartType(); //return "LINE"
if (type.equals("LINE")) {
// rest of code here
}
</code>
If I print out type, it does in fact print LINE, however, type.equals("LINE") returns false.
What am I missing here?
Thanks...
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

is there a space in there? Sometimes there is
 
wood burning stoves
 
subject: problem comparing strings...