code
This function returns the UNICODE character code of the character supplied.
Vectorization: This function supports vectorization in the 1st function parameter.
Instead of providing a single value, you can provide a set or even a nested set which contain multiple values.
The function will then process every value and its return value contains a corresponding set containing all results.
Indirect parameter passing is disabled
Vectorization is allowed in the 1st function parameter
1-2
No. | Type | Description |
---|---|---|
1 input |
string set |
input string Input string containing character to decode, or in case of vectorization: Set ctontaining characters |
Opt. 2 input |
numeral | character position Character position, if a character other than the 1st character needs to be decoded. Negative indexing: Negative values count from right to left, e.g. -1 = last character. Default value: 0 |
Type | Description |
---|---|
numeral set |
character code >0: UNICODE character code |
echo( code( 'Café 4.0 €' ) ); // C
echo( code( 'Café 4.0 €', 3 ) ); // é
echo( code( 'Café 4.0 €', -1 ) ); // €
echo( code( 'Café 4.0 €', 99 ) ); // -1 (out of bounds)
echo( code( '𝄞' ) ); // Violin clef
echo( code( '' ) ); // 0 returned
echo( code( characters(Café) ) ); // Vectorization example
67
233
8364
-1
119070
0
{67,97,102,233}