Objective-C Trim implementation