Objective c 如何在NSString中搜索字符U-FFFD(黑钻石问号)?

Objective c 如何在NSString中搜索字符U-FFFD(黑钻石问号)?,objective-c,nsstring,character,Objective C,Nsstring,Character,我有个问题。我想用空格更改黑钻石问号(U-FFFD)。我如何搜索字符(黑钻石问号),以便用空格更改它?谢谢您的关注。用问号解决黑钻石问题 [theString stringByReplacingOccurrencesOfString:@"\ufffd" withString:@" "]; 只要用这个: foreach($disp as $objs) { $objs = preg_replace( '|[^.?,A-Za-z0-9-]+|', ' ', $objs); echo

我有个问题。我想用空格更改黑钻石问号(U-FFFD)。我如何搜索字符(黑钻石问号),以便用空格更改它?谢谢您的关注。

用问号解决黑钻石问题

[theString stringByReplacingOccurrencesOfString:@"\ufffd" withString:@" "];
只要用这个:

foreach($disp as $objs)
{

    $objs = preg_replace( '|[^.?,A-Za-z0-9-]+|', ' ', $objs);
    echo $objs;
}

// this will display character (.?A-Z AND 0-9) and replace char other than this.