我正在寻找像PHP的爆炸函数一样的Objective-C方法:
$string = "Helle#world#!";
$delimiter = "#";
$array = explode ( $delimiter, $string);
Run Code Online (Sandbox Code Playgroud)
结果:$ array = {"Hello","world","!"}
谢谢,安德烈亚斯
您正在寻找 componentsSeparatedByString:
NSString *string = @"Hello#world#!";
NSString *delimiter = @"#";
NSArray *array = [string componentsSeparatedByString:delimiter];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2245 次 |
| 最近记录: |