Fastest way to get array of NSRange objects for all uppercase letters in an NSString?

后端 未结 4 877
臣服心动
臣服心动 2021-02-10 09:06

I need NSRange objects for the position of each uppercase letter in a given NSString for input into a method for a custom attributed string class. 

There are of course q

4条回答
  •  一整个雨季
    2021-02-10 09:41

    a function such as isupper* in conjunction with -[NSString characterAtIndex:] will be plenty fast.

    *isupper is an example - it may or may not be appropriate for your input.

提交回复
热议问题