MCPcopy Create free account
hub / github.com/ReadyTalk/avian / codePointCount

Method codePointCount

classpath/java/lang/Character.java:240–257  ·  view source on GitHub ↗
(CharSequence sequence, int start, int end)

Source from the content-addressed store, hash-verified

238 }
239
240 public static int codePointCount(CharSequence sequence, int start, int end) {
241 int length = sequence.length();
242 if (start < 0 || start > end || end >= length) {
243 throw new IndexOutOfBoundsException();
244 }
245
246 int count = 0;
247 for (int i = start; i < end; ++i) {
248 if (isHighSurrogate(sequence.charAt(i))
249 && (i + 1) < end
250 && isLowSurrogate(sequence.charAt(i + 1)))
251 {
252 ++ i;
253 }
254 ++ count;
255 }
256 return count;
257 }
258}

Callers 1

codePointCountMethod · 0.95

Calls 4

isHighSurrogateMethod · 0.95
isLowSurrogateMethod · 0.95
lengthMethod · 0.65
charAtMethod · 0.65

Tested by

no test coverage detected