EAGLE Help

strrstr()


Function
Scans a string for the last occurrence of a given substring.

Syntax
int strrstr(string s1, string s2);

Returns
The strrstr function returns the integer offset of the first character of s2 in s1, or -1 if the substring does not occur in the string.

See also strstr, strrchr

Example


string s1 = "This is a string", s2 = "is a";
int pos = strrstr(s1, s2);
if (pos >= 0)
   printf("The substring starts at %d\n", pos);
else
   printf("The substring was not found\n");

Index Copyright © 2001 CadSoft Computer GmbH