lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


My attempt at counting certain records is failing. Does the “string.gsub” require a delimited string? I am trying to use hex without a null at the end.

 

   count = select(2, string.gsub(bytes, 0Xd3, 0xd3))

 

This snippet is attempting to count the occurrences of ‘D3’, and is returning 0. I really need to count 3 byte ‘D3A9AF’ but that fails too. I have tried this many ways. Bytes is 3.4 megabytes of data in case that is part of my problem