Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Lua でテーブルを完全に消去またはリセットするにはどうすればよいですか。最終的には空白のテーブルにしたいです。
キーを反復処理して nil にします。
for k,v in pairs(t) do t[k] = nil end
配列の場合は、table.remove() で値を削除します
この方法はどうですか?
t = {..some non-empty table..} ...some code... t={}