Str.fromhex

From OpenEUO
Jump to: navigation, search

Calling Pattern

Call

local b = sl.str.fromhex(a)

Args

a is a string of hexadecimal characters

Results

b is a string

Usage Example

local s = sl.str
local a = s.tohex('One converted string.')
local r = s.fromhex(a)
print(a)
print(r)
--> 4f6e6520636f6e76657274656420737472696e672e
    One converted string.

Description

Decodes a hexadecimal sequence into a string. Ignores interstitial non-hex characters in the source string.

Upon Error

Fromhex fails silently. If fromhex receives incorrect parameter types, then '' (an empty string) is returned.

See Also