码迷,mamicode.com
首页 > 其他好文 > 详细

characterAtIndex:

时间:2018-09-27 01:42:42      阅读:233      评论:0      收藏:0      [点我收藏+]

标签:compose   dex   ships   cte   important   getc   range   als   topic   

Instance Method

characterAtIndex:

Returns the character at a given UTF-16 code unit index.

  • iOS 2.0+
  • macOS 10.0+
  • tvOS 9.0+
  • watchOS 2.0+
  • Foundation

Declaration

- (unichar)characterAtIndex:(NSUInteger)index;

Parameters

index

The index of the character to retrieve.

Important

Raises an NSRangeException if index lies beyond the end of the receiver.

Return Value

The character at the array position given by index.

Discussion

You should always use the rangeOfComposedCharacterSequenceAtIndex: or rangeOfComposedCharacterSequencesForRange: method to determine character boundaries, so that any surrogate pairs or character clusters are handled correctly.

See Also

Related Documentation

characterAtIndex:

标签:compose   dex   ships   cte   important   getc   range   als   topic   

原文地址:https://www.cnblogs.com/Learning-materials/p/9710700.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!