Lua String

local str = "we are fire \n we are rain we are"

local result = string.split( str, " " )

print("result = ", result )

for key, value in pairs( result ) do

          if value == "\n" then

                        table.remove( result, key )

           end

end

local len = table.getn( result )

print("len = ", len )

你可能感兴趣的:(Lua String)