问题
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 (.?A-Z AND 0-9) and replace char other than this.
来源:https://stackoverflow.com/questions/5270534/how-to-search-character-u-fffd-black-diamond-question-mark-in-nsstring