I have problem with stringByTrimmingCharactersInSet...

stringByTrimmingCharactersInSet has a bug already reported in RADAR…
When the input string is only 1 character long stringByTrimmingCharactersInSet returns an empty string.
The only solution is: don't use it and write your own version…

NB
This bug is reported to be solved in Panther.