Thanks to you!BlackBulletIV wrote:I've added the ability to use plain text (see the split function) and noted your help in the README. Note that by using the division operator, it will default to plain text. Use split for patterns.
I see, it's good but I wonder if it's a good idea to have 2 different default one with div operator and the other with split().
I prefer keep in mind both are equal.
I suggest to set the both to plain with :
Code: Select all
function string:split(pat, plain)
if plain == nil then plain = true end
...
local pos1, pos2 = self:find(pat, 1, plain or false)
Code: Select all
function string:split(pat, plain)
plain = plain == nil and true or plain and true or false
...
local pos1, pos2 = self:find(pat, 1, plain)
Code: Select all
a = "a b c" / (" ", true)
a = "a b c" / (" ", false)