WoW:API strbyte: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
Line 9: Line 9:
  > = string.byte("ABCDE",0)    -- we're not using C
  > = string.byte("ABCDE",0)    -- we're not using C
  > = string.byte("ABCDE",100)  -- index out of range, no value returned
  > = string.byte("ABCDE",100)  -- index out of range, no value returned
[[Category:API Functions|strbyte]]
[[Category:API String Functions|strbyte]]

Revision as of 19:06, 27 August 2005

string.byte(s [, i])

Return the numerical code the i-th character of the string passed.

> = string.byte("ABCDE")      -- no index, so the first character
65
> = string.byte("ABCDE",1)    -- indexes start at 1
65
> = string.byte("ABCDE",0)    -- we're not using C
> = string.byte("ABCDE",100)  -- index out of range, no value returned