-8

How to get expires value.

NString *string = @"XXXXXXXXXXXXXX5fQeRXh3-cas&expires=0998" 

But i required output : 0998

4

3 Answers 3

1
NSArray *arr=[string componentsSeparatedByString:@"&expires="];

And then [arr objectAtIndex:1] will be the required expires value.

Sign up to request clarification or add additional context in comments.

Comments

1

Try below code:

NSString *string = @"XXXXXXXXXXXXXX5fQeRXh3-cas&expires=0998";
NSRange r = [string rangeOfString:@"expires="];
NSString *expStr = [string substringFromIndex:r.location+r.length];

Comments

0

Use NSString method rangeOfString:

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.