Name

find — Return position of a substring

Synopsis

integer find ( string  STRING1 ,
  string  STRING2 );

Parameters

string STRING1

String

string STRING2

Substring

Return

integer

If substring is not found find returns `-1'.

Description

The `find' function searches string for a specified substring (possibly a single character) and returns its starting position.

Returns the first position in STRING1 where the string STRING2 is contained in STRING1.

Usage

  find ("abcdefghi", "efg") -> 4
  find ("aaaaa", "z") -> -1