> For the complete documentation index, see [llms.txt](https://osl.mistium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://osl.mistium.com/legacy-osl-originos/prototype-helpers/.toordarray.md).

# string.toOrdArray

## Description

toOrdArray converts a string to an array of UTF-8 byte values, returning each character's ordinal value in the UTF-8 encoding.

## Parameters

toOrdArray takes no parameters.

## Usage On Strings

```javascript
str = "Hello"
log str.toOrdArray()
// ["72", "101", "108", "108", "111"]
// Returns array of UTF-8 byte values

str = "🌟"
log str.toOrdArray()
// ["240", "159", "140", "159"]
// Unicode characters may use multiple bytes

str = ""
log str.toOrdArray()
// []
// Empty string returns empty array

// Can be used with .ord() for single characters
str = "A"
log str.toOrdArray()
// ["65"]
// Same as str.ord() for single characters
```
