我使用RegexKitLite FrameWorks。如何比較第二封信?
NSString *str = [NSString stringWithString:@"Welcome"];
NSString *newStr [NSString string];
//RegexKitLite.h reference.
newStr = [str stringByReplacingOccurrencesOfRegex:<How To Expression?> withString:@"?"];
我想「歡迎」轉換爲=>「W ??????」;更一般地,爲Apple
,Banana Cake
,Love
,Peach
,Watermelon
...我想隱蔽
Apple => A????
Banana => B?????
Cake => C???
Love => L???
我做一個這些模式(僅HeadLetter顯示)......所有的字存儲在NSMutableArray的所以我訪問
[arr objectAtIndex:i] stringByReplacingOccurrencesOfString:<Expression> withString:@"?"];
如何比較第二個字母與RegularExpression?
我想正則表達式(第二封信比較)不想回答[STR stringByReplacingOccurrencesOfString:@ 「歡迎」 withString:@ 「W ??????」]; –