This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Java in General and the fly likes java trim function is not working when reading excel data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java trim function is not working when reading excel data" Watch "java trim function is not working when reading excel data" New topic
Author

java trim function is not working when reading excel data

Senthi Maha
Greenhorn

Joined: Sep 23, 2010
Posts: 4
From java,I am trying to read the values from excel,excel values have white-spaces in it. I was not able to trim it. java trim function is not working in it. Please help me.
Ravishanker kumar
Ranch Hand

Joined: Jul 20, 2006
Posts: 53
Can you please provide exact code that you are using. There might me some misunderstanding...
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

String.trim() only removes white-space at the begin and end. Not in the middle and remember that it returns a new String object. The value of the original String is not altered.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Senthi Maha
Greenhorn

Joined: Sep 23, 2010
Posts: 4
I got it ... using StringUtils.trim(str) works fine
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java trim function is not working when reading excel data