It's not a secret anymore!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Why is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic

Why is "String".trim() not equal to " String ".trim()

mvPrasad Regula
Ranch Hand

Joined: Sep 14, 2009
Posts: 42
For the following code Equal is printed

For the following code not equal is printed

Prasad Regula
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

Having ignored multiple warnings regarding your display name, your account has been closed.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Why is "String".trim() not equal to " String ".trim()
It's not a secret anymore!