# lengthof

This function returns the length of a value that is of type bitstring, hexstring, octetstring, or any character string.

The length of an universal charstring shall be calculated by counting each combining character and hangul syllable character (including fillers) on its own (see ISO/IEC 10646, clauses 23 and 24).

Related keyword:

- integer
- bitstring
- hexstring
- octetstring
- universal
- charstring

### lengthof(any_string_type value) return integer

Example 1:

const integer c_longeur := lengthof('01001011010'B);

The constant called c_longeur will have the value 11 corresponding to the number of bits in the string.

Example 2:

const integer c_skynda := lengthof('BBC0530A0'H);

The constant called c_skynda will have the value 9 corresponding to the number of octets in the string.

Example 3:

const integer c_laenge := lengthof('80FBBC0530A0'O);

The constant called c_laenge will have the value 6 corresponding to the number of octets in the string.

Example 4:

const integer c_longeco := lengthof("pentristino");

The constant called c_longeco will have the value 11 corresponding to the number of characters in the string.

Example 5:

const integer c_longeur := lengthof("ĉirkaŭĵo");

The constant called c_longeur will have the value 8 corresponding to the number of characters in the string.