(CharSequence sequence, int start, int end)
| 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 | } |
no test coverage detected