This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Trailing squares problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Trailing squares problem" Watch "Trailing squares problem" New topic

Trailing squares problem

James Du
Ranch Hand

Joined: Mar 23, 2001
Posts: 186
I encountered a very low-level problem.
I found the string fetched from db.db maybe have some trailing blanks. the unicode of these characters is '\u0000' and they display trailing squares in the JTable. I had assumed that those characters could be removed by String.trim() but they turned out not to be whitespaces .
How you guys solved the situation? using a loop? it works but a little awkward i think
Any small tricks? :roll:
Siddharth Mehrotra
Ranch Hand

Joined: Aug 21, 2001
Posts: 185
use trim method on the data that u get
this will solve the problem

James Du
Ranch Hand

Joined: Mar 23, 2001
Posts: 186
the trim() method could not do the work, it just remove the whitespaces
I agree. Here's the link:
subject: Trailing squares problem
jQuery in Action, 3rd edition