[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSString -stringByTrimmingSpaces bug
From: |
Richard Frith-Macdonald |
Subject: |
Re: NSString -stringByTrimmingSpaces bug |
Date: |
Thu, 14 Mar 2002 10:58:57 +0000 |
On Thursday, March 14, 2002, at 10:35 AM, Manuel Guesdon wrote:
Hi,
The following case:
' 0' (3 spaces and a character) is badly handled: the method
return an empty string instead of '0'
I think the test
if (start<end)
should be
if (start<=end && end<length)
Thanks ... I looked at that code and noticed that the problem was
actually elsewhere ...
the value of 'end' was being set incorrectly.
All the tail trimming methods were similarly wrong - so I've rewritten
them.