I am programming with objective c and I want to get character’s alphabetical order. For example:
A, a – 1,
B, b – 2,
…
Z, z – 26
Is there a function in Objective C that enables me to achieve this goal?
Thank you in advance,
Ilya.
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.
Well if you can guarantee that the character set is ASCII, then you can just subtract the char from ‘A’ and then add 1 (only add one if you want to start counting at 1 instead of 0).
Ex: