Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 The Software Craftsman this week in the Agile 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: 19531
    
  42

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 tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Compare Content of StringBuilder