--- title: "code-from-char()" slug: "string-code-from-char" updated: 2026-08-13T13:41:49Z published: 2026-08-13T13:41:49Z canonical: "docs.lobstersoftware.com/string-code-from-char" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # code-from-char() This function returns the numerical Unicode value of the first character in parameter **a** as an Integer value. If parameter **a** contains more than one character, it is possible to specify a list object in parameter **b**, which receives the codes of all the characters in **a**. The display mode of the character codes in the list can be set in parameter **c**. ## Parameters | Parameter | Description | | --- | --- | | a | String containing one or more characters. **NOTE:** If empty, the return value of the function is *0* and the list **b** remains empty. | | b | (optional) Name of a list to receive the codes of all characters from parameter **a**. **NOTE:** The list is emptied at the beginning. | | c | (optional) Display mode of the character codes in list **b**. Possible values are *i*, *u*, *x* (corresponds to Integer/Unicode/hexadecimal). In mode *i* the list values have data type *Integer*, for all other modes the data type is *String*. Default: *i*. | ## Examples | Parameter a | Parameter b | Parameter c | Return value | Values in list b | Data type in list b | | --- | --- | --- | --- | --- | --- | | | | | 0 | | | | A | | | 65 | | | | A | list1 | | 65 | 65 | Integer | | B | list1 | | 66 | 66 | Integer | | C | list1 | | 67 | 67 | Integer | | ABC | list1 | | 65 | 65,66,67 | Integer | | € | list1 | | 8364 | 8364 | Integer | | 10 € | list1 | | 49 | 49,48,32,8364 | Integer | | 10 € | list1 | i | 49 | 49,48,32,8364 | Integer | | 10 € | list1 | x | 49 | 0x31,0x30,0x20,0x20ac | String | | 10 € | list1 | u | 49 | \u0031,\u0030,\u0020,\u20ac | String |