Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Ron McLeod
paul wheaton
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Himai Minh
Bartenders:
Forum:
Programmer Certification (OCPJP)
Why is "String".trim() not equal to " String ".trim()
mvPrasad Regula
Ranch Hand
Posts: 42
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
For the following code Equal is printed
if("String".trim() == "String".trim()) System.out.println("Equal"); else System.out.println("Not Equal");
For the following code not equal is printed
if(" String ".trim() == "String".trim()) System.out.println("Equal"); else System.out.println("Not Equal");
Prasad Regula
Bear Bibeault
Sheriff
Posts: 67754
173
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Having ignored multiple warnings regarding your display name, your account has been closed.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
string operation
Trim()
q from abhilash mock exam on strings.
Doubts in Strings
String Confusion
More...