This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String Buffer

 
jon ladd
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a buffer that is reference of a StringBuffer object that contains some text. If I code a statement to convert the entire contents of the object to uppercase.
Do I want to Start with
String toUppercase()
Or is this way off, I am using java tutorial as my reference guide.
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a simple way to do it would be to use the StringBuffer's toString() method, and then use the String's toUpperCase() method, you could also write your own quicker method, as well as use the overloaded toUpperCase(Locale locale) method also in the String class.
but heres a quick solution
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic