Escape string for Lua's string.format -
i have string need add variable use string.format method, string contains symbol "%20" (not sure represents, white space or something). anyway since string contains multiple "%" , want add variable first 1 set id, there way escape string @ points or something?
as now:
id = 12345 string.format("id=%s&x=foo=&bar=asd%20yolo%20123-1512", id) i bad argument #3 'format' (no value). error -- since expects 3 variables passed.
you can escape % %, e.g. string.format("%%20") give %20
Comments
Post a Comment