This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Compare Content of StringBuilder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compare Content of StringBuilder" Watch "Compare Content of StringBuilder" New topic
Author

Compare Content of StringBuilder

Nestor Alduey
Greenhorn

Joined: Jul 30, 2006
Posts: 26
Hi All,

How can I compare if are equals in caracters, like I compare strings, because when I use equals method it compares only the object and not the caracters.

How can I do in this case?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 20057
    
  44

I believe the way to do this is to use toString() to get the strings, and compare them.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
Have you checked out Aspose?
 
subject: Compare Content of StringBuilder
 
jQuery in Action, 3rd edition