adrianoswatt

doCutStrings

Dec 8th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. -- 13º Separa Texto
  2. function doCutStrings(cid, word, cutType) -- cutType [Ex: ","]
  3. local cutWord = {}
  4.     if word then
  5.         local string = tostring(word)
  6.         local cutWord = string:explode(cutType)
  7.         if #cutWord > 0 then
  8.             for i = 1, #cutWord do
  9.                 table.insert(cutWord, cutWord[i])
  10.             end
  11.             return cutWord
  12.         else
  13.             return cutWord and true
  14.         end
  15.     --- WORD NOT DECLARED
  16.     else
  17.         print('Palavra não declarada para recorte [Function doCutStrings].')
  18.         return true
  19.     end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment