instr

instr has 1 variant:

Description

instr function returns the location of a substring in a string. If substring is not found in string, then the instr function will return 0.

Declaration

int instr(char string, char substring);

Parameters

  1. char string

  2. char substring

Return Value

Example

int pos;pos = instr("Tech on the net", "e");

Result: 2 (the first occurrence of 'e'

See also

Last updated

Was this helpful?