Method

# Chr

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Returns the character whose Unicode code point is passed.

## Usage

``` xojo
result = Chr(value)
```

| Part   | Type                               | Description                                                                                          |
|--------|------------------------------------|------------------------------------------------------------------------------------------------------|
| result | `String</api/data_types/string>`   | The character whose Unicode code point was passed.                                                   |
| value  | `Integer</api/data_types/integer>` | The numeric value ("code point") of the character you want, which must be a valid Unicode character. |

## Notes

The <span class="title-ref">Chr</span> function returns a string in ASCII encoding for values less than 128 and a UTF-8 encoded string for all other values. If you need to control the exact byte value, you should instead call `String.ChrByte<string.chrbyte>`.

## Sample code

This code use the <span class="title-ref">Chr</span> function to return the characters whose ASCII values are specified.

``` xojo
Var tab, CR As String
tab = Chr(9) ' returns a tab
CR = Chr(13) ' returns carriage return
CR = Encodings.ASCII.Chr(13) ' also returns carriage return
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`Asc</api/math/asc>`, `Encoding</api/text/encoding_text/encoding>`, `String.IndexOf<string.indexof>`, `String.Left<string.left>`, `String.Length<string.length>`, `String.Middle<string.middle>`, `String.Right<string.right>` functions; `EndOfLine</api/text/endofline>`, `TextEncoding</api/text/encoding_text/textencoding>` classes; `Encodings</api/text/encoding_text/encodings>` module; `String</api/data_types/string>` data type

</div>
