How to search character U-FFFD (black diamond question mark) in NSString?
问题 I have a problem. I want to change the black diamond question mark (U-FFFD) with white space. How could I search the character (black diamond question mark) so I can change it with white space? Thank you for your attention. 回答1: [theString stringByReplacingOccurrencesOfString:@"\ufffd" withString:@" "]; 回答2: Solve black diamond with question mark. just use this: foreach($disp as $objs) { $objs = preg_replace( '|[^.?,A-Za-z0-9-]+|', ' ', $objs); echo $objs; } // this will display character (.