现在位置 >首页 > strrpos
2℃
2012年08月24日 Lua ⁄ 被围观 14,116 次+
刚才写一个lua上实现php中的strpos()函数,下面在来个strrpos()函数,查找某个字符串在指定字符串最后一次出现的位置,下面我们还是简单写一下函数,代码如下: function strrpos (str, f)        if str ~= nil and f ~= nil then            local t = true           local offset = 1           local result = nil            while (t)            do               local tmp = string.find(str, f, offset)                if tmp ~= nil then                    offset = offset + 1                ...
阅读全文