usahsauuasushsahushaauashshusauhs
stirng.up sua so funciona com letras até j
usase pelo menos byte e char
mano quanta variveis sem sentido,siceramente n da nem pra intede o que faz essa função pass()
e tbm n era mais facil cata metatable de string ao inves de cria uma tabela com um index de nome string com a string?



info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: No Have
Tava sem nada para fazer e fiz estas funções atoa.
Eu não ia postar mais....
local Str = {string = ""} function Str:new(new) local st = {string = new} return setmetatable(st, {__index = self}) end function Str:reverse() k = #self.string newstr = "" while k > 1 do local str = string.sub(self.string, k, k) newstr = newstr..str k = k-1 end return newstr end function Str:table() x = {} for i=1, #self.string do sub = string.sub(self.string, i, i) table.insert(x, sub) end return x end function Str:pass() local x = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"} k = 1 y = "" for z=1, #x do for i=1, #self.string do local sub = string.sub(self.string, i, i) if sub == x[z]then local t = string.byte(sub)-96 y = y..t end end end return y end function Str:UP() local table = { ["a"] = "A", ["b"] = "B", ["c"] = "C", ["d"] = "D", ["f"] = "F", ["g"] = "G", ["h"] = "I", ["j"] = "J" } for k=1, #self.string do local sub = string.sub(self.string, k , k) if table[sub] then self.string = string.sub(self.string, 0, k-1)..table[sub]..""..string.sub(self.string, k+1, #self.string).."" end end return self.string endEditado Fevereiro 18 por caotic