This is an example, to show how
GeSHi can highlight lua-sourcecode.
Since there have been some misstakes in the lua.php (which is delivered with geshi), you can find an
improved one as download.
function split ( seperator, str )
local pos, arr = 0, {}
for st, sp in function() return string.find( str, seperator, pos, true ) end do -- for each divider found
table.insert( arr, string.sub( str, pos, st-1 ) ) -- Attach chars left of current divider
pos = sp + 1 -- Jump past current divider
end
table.insert( arr, string.sub( str, pos ) ) -- Attach chars right of last divider
return arr
end
Loading...