codeLength

fnubyte codeLength(C)(dchar c) if (isSomeChar!C) @safe pure nothrow @nogc

Returns the number of code units that are required to encode the code point c when C is the character type used to encode it.

fnsize_t codeLength(C, InputRange)(InputRange input) if (isSomeFiniteCharInputRange!InputRange)

Returns the number of code units that are required to encode str in a string whose character type is C. This is particularly useful when slicing one string with the length of another and the two string types use different character types.

Parameters

Cthe character type to get the encoding length for
inputthe input range to calculate the encoding length from

Returns

The number of code units in input when encoded to C