references/sleep-functions/byteAt.md

GitHub

byteAt

Category: Strings

Source: https://sleep.dashnine.org/manual/byteAt.html


Synopsis

$ byteAt("string", n)

Returns the byte at the n'th position in the string

Parameters

"string" - the string to extract the byte value from.

n - the string position to extract the byte value from.

Returns

A scalar integer.

Examples

Example:

$string = "hello world";

for ($x = 0; $x < strlen($string); $x++)
{
print(byteAt($string, $x) . " ");
}

println();

Output:

104 101 108 108 111 32 119 111 114 108 100

See Also

&charAt; &left; &mid; &right; &strlen; &substr