string.gfind

From Garry's Mod
Jump to: navigation, search
 string.gfind( )

Contents

Description

This feature is deprecated.
You should avoid using it as it may be removed in a future version.

This function is removed in Lua versions later than what GMod is currently using. Use string.gmatch instead.
Returns an iterator function that is called for every complete match of the pattern, all sub matches will be passed as to the loop.

Arguments

string data

The string to search in

Arguments

string pattern

The pattern to search for

Returns

function

The iterator function that can be used in a for-in loop

Examples

Example

Example usage of the function

local s = "my awesome stuff 12"
for w in string.gfind(s, "(%a)") do
    Msg(w)
end

Output:

In your console: myawesomestuff
Personal tools
Navigation