A chuzzled object is nil if it is falsy, otherwise it has its falsy parts removed.
For example:
@"".chuzzleisnil- Also
@" ".chuzzleisnil - And
@"\r\t".chuzzleisnil @" 2 ".chuzzleis@"2"@[].chuzzleisnil@[@"", @1].chuzzleis@[@1][NSNull null].chuzzleisnil@{}.chuzzleisnil@{@1: @""}.chuzzleisnil@{@1: @"", @2: @" 2 "}.chuzzleis@{@2: @"2"}
Note that:
@" 2 3 "chuzzles to:@"2 3", that is, it only trims the string, it doesn’t eat the internal whitespace. This is because the “falsy” whitespace is just the trailing whitespace, not the internal whitespace. This is probably what you expected.
We removed mutable chuzzling. There are issues with adding category methods to mutable variants in Cocoa, which led to us having to enact hacks. However there were unexpected issues, eg: #3
All our chuzzle methods on container classes will call chuzzle on the objects they contain, if it is implemented.
So if you want to support recursive chuzzling on your own objects, simply implement a chuzzle method.
Since NSNull cannot be encoded into a PLIST, a convenient (but by no means the primary) usage of ChuzzleKit is to make saving JSON to a plist not crash (eg. via writeToFile:atomically).
-chuzzle can be a less enormous alternative to -stringByTrimmingCharactersInSet:, just don’t forget to expect nil in the response.