Difference between revisions of "String.byte"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Returns the internal numerical codes of the characters s[i], s[i+1], ···, s[j].
 
Returns the internal numerical codes of the characters s[i], s[i+1], ···, s[j].
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(numbers) = string.byte(s,i,j)
 
(numbers) = string.byte(s,i,j)
 
</source>
 
</source>

Revision as of 15:31, 13 July 2023

Available since: Gideros 2011.6
Class: string

Description

Returns the internal numerical codes of the characters s[i], s[i+1], ···, s[j]. <syntaxhighlight lang="lua"> (numbers) = string.byte(s,i,j) </source>

The default value for i is 1; the default value for j is i.

Returns nil if index out of range.

Numerical codes are not necessarily portable across platforms.

Parameters

s: (string) string to get numerical codes from
i: (number) start symbol (default = 1) optional
j: (number) end symbol (defaults = i) optional

Return values

Returns (numbers) numerical codes of characters in provided range or nil