This Question is Answered

1 "correct" answer available (4 pts) 1 "helpful" answer available (2 pts)
2 Replies Last post: Jul 9, 2008 6:14 AM by Jean-Philippe Melanson  
Jean-Philippe Melanson Novice 20 posts since
Jun 5, 2008
Currently Being Moderated

Jul 4, 2008 1:05 PM

StringUtils.abbreviate() return wrong result

I have the following line of code :

 

StringUtils.abbreviate( StringUtils.removeIgnorableCharacters(message.getBody()), 500 )

 

It is supposed to format the body of message for a RSS feed.

However, passing a message with a body of over 500 characters result in "..." .

The removeIgnorableCharacters() returns the correct body.

 

Is it reproduceable ?

 

Thanks,

Vinh Expert 1,976 posts since
Apr 1, 2008
Currently Being Moderated
Jul 8, 2008 6:56 PM in response to: Jean-Philippe Melanson
Re: StringUtils.abbreviate() return wrong result

Is there a newline at the beginning of the message? If there is, it'll chop the message right away (or wherever the \n is) and all you'll get is the text leading up to that newline.

More Like This

  • Retrieving data ...