lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Luiz Henrique de Figueiredo wrote:
Though var:sub(i,j) is shorter than string.sub(var,i,j), I often feel that it's still too long for this very basic operation.

But is it that basic? I found myself extracting substrings mostly
through patterns.

IMHO, it is the most basic of all the string functions ("basic" and "frequently used" isn't the same thing).

Out of curiosity, I inspected Lua files in my local repository to find out the frequency of use of the string functions (including Lrexlib and LPeg ones):
    match   876
    gsub    260
    find    220
    sub     215
    gmatch   74