> For the complete documentation index, see [llms.txt](https://hyundai-robotics.gitbook.io/hi6-robot-language/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hyundai-robotics.gitbook.io/hi6-robot-language/rl-english/basic-syntax/function/func-string.md).

# 2.9.2 String Functions

Examples with var str="hello, world" executed;

| Function                 | Description                                                                                                                                                    | Example of usage                                  | Result             |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | ------------------ |
| bin(**a**)               | Returns the string of number **a** in binary representation                                                                                                    | bin(0b0010)                                       | "10"               |
| chr(**a**)               | Returns the character with **a** of the ASCII code in string type                                                                                              | chr(65)                                           | "A"                |
| double(**s**)            | Returns the real number type value of the real number string **s** (Interpret only up to the position where interpretation is possible, and discard the rest.) | double("29.38E-2")                                | 0.2938             |
| hex(**a**)               | Returns the string of number **a** in hexadecimal representation                                                                                               | hex(0x7A2F)                                       | "7A2F"             |
| int(**s**)               | Returns the integer type value of the integer string **s** (Interpret only up to the position where interpretation is possible, and discard the rest.)         | <p>int("13.25")</p><p>int("29.38E-2")</p>         | <p>13</p><p>29</p> |
| left(**s**, **n**)       | Returns a string of the first **n** characters of the string **s**                                                                                             | left(str, 3)                                      | "hel"              |
| len(**s**)               | Returns the length of the string if **s** is a string and returns the number of elements in the array if **s** is an array                                     | <p>len("HELLO")</p><p>len(\[20, 30, 80])</p>      | <p>5</p><p>3</p>   |
| mid(**s**, **i**, **n**) | Returns a string of **n** characters starting from the **i**-th character of the string **s** (The position of the first character is 0.)                      | mid(str, 3, 5)                                    | "lo, w"            |
| mirror(**s**)            | Returns the string inverted from the string **s**                                                                                                              | mirror("HELLO")                                   | "OLLEH"            |
| right(**s**, **n**)      | Returns a string of the last **n** characters of the string **s**                                                                                              | right(str, 3)                                     | "rld"              |
| str(**a**)               | Returns a string of number **a** in decimal representation                                                                                                     | str(13.25)                                        | 13.250000          |
| strops(**s**, **p**)     | Returns the first position in the string **s** that matches the string **p** (The first character position will be 0 or -1 if there is none.)                  | <p>strpos(str, "llo")</p><p>strpos(str, "hi")</p> | <p>2</p><p>-1</p>  |
