Garry's Mod Wiki

string.byte

string.byte

  vararg string.byte( string string, number startPos = 1, number endPos = startPos )

Description

Returns the given string's characters in their numeric ASCII representation.

This function will throw an error if the slice length is greater than 8000 characters.

Arguments

1 string string
The string to get the chars from.
2 number startPos = 1
The first character of the string to get the byte of.
3 number endPos = startPos
The last character of the string to get the byte of.

Returns

1 vararg
Numerical bytes

Example

Prints the first 4 numerical bytes from the string "Hello, World!"

print(string.byte("Hello, World!", 1, 4))
Output: 72 101 108 108

Special Pages


Wikis

?

Render Time: 62ms

DB GetPage 41
Generate Html 4
SaveChanges (1) 7
Render Body 0
Render Sidebar 7