# toString ## Category String ## Arity **Unary** — `toString `. ``` toString // array of character codes (integers) ``` ## Description Converts an array of character codes (integers) into a string. Each integer is interpreted as a Unicode code point. This is the reverse of [toArray](toArray.md). ## How It Works Iterates the array, casts each integer to `char`, and builds a new string. Non-integer values or values outside the valid char range may produce unexpected characters. ## Usage ### Basic conversion ```sqf toString [65, 66]; // "AB" toString [72, 101, 108, 108, 111]; // "Hello" toString []; // "" (empty string) ``` ### Building strings from codes ```sqf _newline = toString [10]; // line feed _tab = toString [9]; // tab _space = toString [32]; // space ``` ### Round-trip with toArray ```sqf _original = "SQF"; _codes = toArray _original; // [83, 81, 70] _restored = toString _codes; // "SQF" ``` ### Dynamic character generation ```sqf // Generate "ABC...Z" _letters = []; for "_i" from 65 to 90 do { _letters pushBack _i; }; _alphabet = toString _letters; // "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ``` ### Simple obfuscation / encoding ```sqf _encode = { params ["_str"]; _codes = toArray _str; _shifted = []; { _shifted pushBack (_x + 1) } forEach _codes; toString _shifted }; _encoded = "hello" call _encode; // "ifmmp" ``` ## Thread Safety ReadOnly — pure computation, returns new string. Safe from any scheduler. ## See Also - [toArray](toArray.md) — reverse: string to code array - [str](str.md) — general value to string - [format](format.md) — formatted string output