Home  Contents

string.rawfind

String Core4 Lua Commands

SYNOPSIS

result = string.rawfind(haystack, needle[, start])

DESCRIPTION

Searches for the string needle inside of the string haystack, starting at position start.
The default value for start is 1.
This function does not do any special character processing as gsub would.

RETURN VALUE

On success the index within haystack where needle was found, or nil on failure.

ERRORS

Both arguments must be strings, or an error is thrown.

EXAMPLE

print(string.rawfind("This is some text", "is"))
3
print(string.rawfind("This is some text", "is", 4))
6

SEE ALSO