Is there any way to replace a character at position N in a string in Lua.
This is what I\'ve come up with so far:
function replace_char(pos, str, r)
With luajit, you can use the FFI library to cast the string to a list of unsigned charts:
local ffi = require 'ffi' txt = 'test' ptr = ffi.cast('uint8_t*', txt) ptr[1] = string.byte('o')