The OpenD Programming Language

count

Returns the total number of code points encoded in str.

Supercedes: This function supercedes toUCSindex.

@safe pure nothrow @nogc
size_t
count
(
C
)
(
const(C)[] str
)

Throws

UTFException if str is not well-formed.

Examples

assert(count("") == 0);
assert(count("a") == 1);
assert(count("abc") == 3);
assert(count("\u20AC100") == 4);

Meta

Standards

Unicode 5.0, ASCII, ISO-8859-1, WINDOWS-1252