I was taking a look at this thread and saw that you needed a string handling function still...
this code takes a string with "breaker" points in it and removes the breakers / splits the output into a table.
-- Our string splitting Function
function string:split( inSplitPattern, outResults )
if not outResults then
outResults = { }
end
local theStart = 1
local theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
while theSplitStart do
table.insert( outResults, string.sub( self, theStart, theSplitStart-1 ) )
theStart = theSplitEnd + 1
theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
end
table.insert( outResults, string.sub( self, theStart ) )
return outResults
end
The function is called by inserting this type of code
mess = "test code write message"
tablemes = string.split(mess, " ") -- This is the string splitter and its processing.
message = tablemes[1] -- --> output of "test"
pas = tablemes[2] -- --> Output of "code"
The default for the script is to remove a SPACE char. but by changing what you send to the script it can remove any char.