I have a NSString(e.g. ‘P1’)
I have to add 1 in this NSString to get ‘P2’.
How will i do this??
Thanks for any help.
I have a NSString(e.g. ‘P1’) I have to add 1 in this NSString to
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can convert your
NSStringto anNSIntegerlike so:In your case if
myStringwas your string P1,myIntegerwould be 1. So you could then do:Which would then make
myInteger2. To then put that number back after P do:Now
myStringis P2.