This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
It is sorta covered in the JavaRanch Style Guide.
subject: Trailing squares problem
Similar Threads
paste text from Word into html editor
how to prevent image from disappearing?
Filechooser in Japanese hosts