CMC logo Cave Man Code

find

Text

Where does a smaller text start inside a bigger text?

How to write it

find(<text>, <piece>)

What it does

find(text, piece) gives the spot number where piece starts inside text, or -1 when it is not there at all.

Example

grunk word = "caveman"
oga find(word, "man")   ugg 4
oga find(word, "z")     ugg -1

Tips

See also

skoop · split · nom

Back to all words