GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — algorithm/lua_string_to_table.lua at master · ring04w/algorithm Expand file tree/ Copy pathlua_string_to_table.luaMore file actions 13 lines (10 loc) · 397 Bytes / Copy pathlua_string_to_table.luaFile metadata and controls13 lines (10 loc) · 397 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 --在LUA中,没有类似python的str.split()函数,如果要将一个字符串按照指定的符号分割,并存到table中。 --如将a="1,2,3"转换为{1,2,3} a="1,2,3,4," --或者 a="1,2,3,4" 不论最后一个是否有"," t={} for w in string.gmatch(a,"([^',']+)") do --按照“,”分割字符串 table.insert(t,w) end for k,v in ipairs(t) do print(k..":"..v) end |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |