.codePointCount()

Victoria-DR22 total contributions
Published Jul 23, 2021Updated Oct 5, 2021
Contribute to Docs
Returns the number of Unicode values in specified range of a string.
Syntax
string.codePointCount(int indexStart, int indexEnd)
indexStart
(required): The index of the first character in the string to start counting from.indexEnd
(required): One more than the index of the last character in the string to stop counting at.
Example 1
Print the number of Unicode values in the string "Hello World"
:
class CountUnicodeValues {public static void main(String[] args) {String s = "Hello World";System.out.println(s.codePointCount(0, 10));// Output: 10}}
All contributors
- Victoria-DR22 total contributions
- christian.dinh2481 total contributions
- Anonymous contributorAnonymous contributor3077 total contributions
- robgmerrill124 total contributions
- Victoria-DR
- christian.dinh
- Anonymous contributor
- robgmerrill
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.