Skip to content

Instantly share code, notes, and snippets.

@iddm
Forked from iwanbk/split_string_by_line.lua
Created September 14, 2021 18:47
Show Gist options
  • Save iddm/739396dc520ba6c9ec4744d2b8aa6d2f to your computer and use it in GitHub Desktop.
Save iddm/739396dc520ba6c9ec4744d2b8aa6d2f to your computer and use it in GitHub Desktop.
Split string by line in Lua
for line in yourString:gmatch("([^\n]*)\n?") do
-- do something
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment