if string is alphabetically greater than other string in objective
- by Jonathan
I'm trying to use an if statement to work out which of 2 strings comes first alphabetically. Like with numbers and greater and less than:
if (1 < 2) {
just with strings:
if(@"ahello" < @"bhello") {
Or would I have to have a string containing all the letters and then check the index of the first char in each string and see which index is greater, and the index that is less than the other comes first in the alphabet and then if they are equal move on to the next char and repeat?