Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compare Content of StringBuilder

 
Nestor Alduey
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21413
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the way to do this is to use toString() to get the strings, and compare them.

Henry
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic