Is there an easy way to programmatically get the alphabet?

前端 未结 5 1359
臣服心动
臣服心动 2021-02-04 12:11

I want an NSArray/NSMutableArray containing all the letters of the alphabet. There must be a quick and easy way, better than typing them all out. For example in PHP

5条回答
  •  借酒劲吻你
    2021-02-04 12:57

    try with following code;

    
    int a = 65;
    for (; a < 91; a++) {
        [array addObject:[NSString stringWithFormat:@"%c", (char)a]];
    }
    NSLog(@"%@", array);
    

提交回复
热议问题