Java Character offsetByCodePoints() MethodThe offsetByCodePoints(char[]a, int start, int count, int index, int codePointOffset) method of Character class returns the specified index within the given char sub-array which has been offset by codePointOffset codePoints. The start and count parameter specifies a sub-array of the char array. All the unpaired surrogates which lie in the text range given by the index and the codePointOffset are counted as one codePoint each. SyntaxParameterThe above method requires five parameters:
Return ValueThe offsetByCodePoints(char[]a, int start, int count, int index, int codePointOffset) method returns the specified index within the subarray. Example 1Output: The index within the subarray ch is given as: 6 Java Character offsetByCodePoints(CharSequence seq, int index, int codePointOffset) MethodThe offsetByCodePoints(CharSequence seq, int index, int codePointOffset) method of Character class returns the specified index within the given character sequence which has been offset from the given index by the codePointOffset codePoints. All the unpaired surrogates which lie in the text range given by the index and the codePointOffset are counted as one codePoint each. SyntaxParameterThe above method requires three parameters:
Return ValueThe offsetByCodePoints(CharSequence seq, int index, int codePointOffset) method returns the specified index in the character sequence. Example 1Output: The result for the above method can be represented as:24 Next TopicJava-character-reversebytes-method |