string.find
From GMod Wiki
Function | |
Syntax |
string.find( String string, String pattern[, Number startindex, Boolean plain] ) Where is this used? |
Description: | |
Returns the start and end positions of the first occurance of pattern starting at startindex till the end of the string, if startindex is not given then it will do from 1 to the end of the string. nil is returned if the pattern cannot be found. | |
Returns: | Integer , Integer |
Part of Library: | String |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=String.find]String.find [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Notes
- A complex search can be used for the pattern argument such as a regular pattern (patterns tutorial). If the plain argument is true then regular patterns are disabled and plain text is used. It returns nil if it cannot find the pattern.
- Returns nil if the word to search for wasn't found.