char_count


Description:

public int char_count (ssize_t max = -1)

Computes the length of the string in characters, not including the terminating nul character.

If the max'th byte falls in the middle of a character, the last (partial) character is not counted.

Parameters:

max

the maximum number of bytes to examine. If max is less than 0, then the string is assumed to be nul-terminated. If max is 0, p will not be examined and may be null. If max is greater than 0, up to max bytes are examined

p

pointer to the start of a UTF-8 encoded string

Returns:

the length of the string in characters