Вопрос по iphone, objective-c, xcode – как удалить первые 3 символа из nsstring?

68

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Ваш Ответ

4   ответа
1

Error: User Rate Limit ExceededHow do I remove "A. "?

NSString * name =  @"A. rahul VyAs";
NSString * prefixToRemove = @"A. "; 
name = [name stringByReplacingOccurrencesOfString:prefixToRemove withString:@""];

This code will remove what you tell it to remove/change if the character set exists, such as "A. "Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededrahulError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceededor changeError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit ExceededA. Error: User Rate Limit Exceeded
241

Error: User Rate Limit ExceededNSStringError: User Rate Limit ExceededsubstringWithRange:Error: User Rate Limit ExceededsubstringFromIndex:

NSString *str = @"A. rahul VyAs";
NSString *newStr = [str substringWithRange:NSMakeRange(3, [str length]-3)];

Error: User Rate Limit Exceeded

NSString *str = @"A. rahul VyAs";
NSString *newStr = [str substringFromIndex:3];
Error: User Rate Limit Exceeded
-1

Error: User Rate Limit Exceeded

myString = [myString subStringFromIndex:3]

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
2

Error: User Rate Limit Exceeded

char *string=[@"A. rahul VyAs" cStringUsingEncoding:NSUTF8StringEncoding];
char *subString=&name[3];
NSString *newString=[NSString stringWithCString:subString encoding:NSUTF8StringEncoding];

Похожие вопросы