Fixed: stringByTrimmingCharactersInSet not removing characters at end

If a string had characters from the set at both the start and end,
the end trim was one character less than required.
Merge pull request #1869 from sherab/stringByTrimmingCharactersInSet-fix

Fixed: stringByTrimmingCharactersInSet not removing characters at end