1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
<html>
<head>
<title>EAGLE Help: strrstr()</title>
</head>
<body bgcolor=white>
<font face=Helvetica,Arial>
<hr>
<i>EAGLE Help</i>
<h1><center>strrstr()</center></h1>
<hr>
<dl>
<dt>
<b>Function</b>
<dd>
Scans a string for the last occurrence of a given substring.
<p>
<dt>
<b>Syntax</b>
<dd>
<tt>int strrstr(string s1, string s2[, int index]);</tt>
<p>
<dt>
<b>Returns</b>
<dd>
The <tt>strrstr</tt> function returns the integer offset of the
first character of s2 in s1, or <tt>-1</tt> if the substring does not
occur in the string.
<p>
</dl>
<b>See also</b> <a href=265.htm>strstr</a>,
<a href=262.htm>strrchr</a>
<p>
If <tt>index</tt> is given, the search starts at that position.
Negative values are counted from the end of the string.
<p>
<b>Example</b>
<pre>
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");
</pre>
<hr>
<table width=100% cellspacing=0 border=0><tr><td align=left><font face=Helvetica,Arial>
<a href=index.htm>Index</a>
</font></td><td align=right><font face=Helvetica,Arial size=-1>
<i>Copyright © 2005 CadSoft Computer GmbH</i>
</font></td></tr></table>
<hr>
</font>
</body>
</html>
|