0
objective-cの正規表現に類似したものはありますか?正規表現のようなもの
私は文字のセットを、以下で区切られたから要素を取得する簡単な方法が必要になります。
"\n"
", "
"; "
現在、私は次のコードを持っている:
NSMutableArray *translations = [ [NSMutableArray alloc] init];
NSArray *temp_array1 = [ [translationsView text] componentsSeparatedByString:@"\n"];
for (int i = 0; i < [temp_array1 count]; i++)
{
NSArray *temp_array2 = [ [temp_array1 objectAtIndex: i] componentsSeparatedByString:@", "];
for (int j = 0; j < [temp_array2 count]; j++)
{j]);
[translations addObject: [temp_array2 objectAtIndex: j] ];
}
}
をしかし、私は、同様のサポートを実装したいです";"セパレータ。私がそれをやり遂げるのと同じ方法でそれをやろうとすれば、それは複雑になる前にそれを行うでしょう。
この目標を達成するための簡単な方法はありますか?
ありがとうございます。