在 PHP 中,我可以这样做:
$new = str_replace(array('/', ':', '.'), '', $new);
...替换字符 / : 的所有实例。带有空白字符串(删除它们)
我可以在 Objective-C 中轻松做到这一点吗?还是我必须自己动手?
目前我正在多次调用stringByReplacingOccurrencesOfString
:
strNew = [strNew stringByReplacingOccurrencesOfString:@"/" withString:@""];
strNew = [strNew stringByReplacingOccurrencesOfString:@":" withString:@""];
strNew = [strNew stringByReplacingOccurrencesOfString:@"." withString:@""];
谢谢,
马特