Advertisement
adrianoswatt

doCutStrings

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