Unpack Objects from a Binary String
(...) = unpack (String_Type fmt, BString_Type s)
The unpack function unpacks objects from a binary string
s according to the format fmt and returns the objects to
the stack in the order in which they were unpacked. See the
documentation of the pack function for details about the
format string.
(x,y) = unpack ("cc", "AB"); % ==> x = 'A', y = 'B'
x = unpack ("c2", "AB"); % ==> x = ['A', 'B']
x = unpack ("x<H", "\0\xAB\xCD"); % ==> x = 0xCDABuh
x = unpack ("xxs4", "a b c\0d e f"); % ==> x = "b c\0"
x = unpack ("xxS4", "a b c\0d e f"); % ==> x = "b c"
|