-
Notifications
You must be signed in to change notification settings - Fork 0
toArray
ffredyk edited this page Jul 23, 2026
·
1 revision
String
Unary — toArray <string>.
toArray <string>
Converts a string to an array of character codes (ASCII/Unicode code points as integers). Each character becomes one integer element in the result array. Empty string → empty array.
Iterates each char in the string, casts to int, and collects into a new array. For characters above U+FFFF (surrogate pairs), each surrogate half is a separate element.
toArray "AB"; // [65, 66]
toArray "Hello"; // [72, 101, 108, 108, 111]
toArray ""; // []_codes = toArray _name;
_codes forEach {
systemChat f"Char code: {_x}";
};_codes = toArray _name;
_firstCode = _codes select 0;
_isUpper = _firstCode >= 65 && _firstCode <= 90;_original = "Test";
_codes = toArray _original;
_restored = toString _codes; // "Test"
_original == _restored; // trueReadOnly — pure computation, returns new array. Safe from any scheduler.
- Getting Started
- Language Guide
- Type System
- Control Flow
- Functions & Code
- Strings & Text
- Arrays & Collections
- Concurrency
- Promise System
- Thread Safety
- Host API & Embedding
- CLI Tool
- Bytecode Reference
- Multiplayer
- Syntax Sugar
- Optimization Guide
- Benchmarks
- count
- select
- pushBack
- append
- deleteAt
- deleteRange
- resize
- reverse
- sort
- find
- in
- forEach
- freeze
- thaw
- isFrozen
- currentScheduler
- clientOwner
- allSchedulers
- schedulerName
- schedulerExists
- schedulerBudget
- setSchedulerBudget
- fiberCount
- readyFiberCount
- waitingFiberCount
- schedulerLoad
- sendTo