This commit is contained in:
fofolee
2019-04-21 11:50:48 +08:00
parent 359d29ee0b
commit 38dcd51d8a
6901 changed files with 258583 additions and 2326828 deletions

View File

@@ -1,36 +1,36 @@
<h1>字符串函数 - strcspn</h1>
<p>原型extern int strcspn(char *s1,char *s2);</p>
<p>用法:#include &lt;string.h></p>
<p>功能在字符串s1中搜寻s2中所出现的字符。</p>
<p>说明返回第一个出现的字符在s1中的下标值亦即在s1中出现而s2中没有出现的子串的长度。</p>
举例:<pre><code class="language-c">
// strcspn.c
#include &lt;syslib.h>
#include &lt;string.h>
main()
{
char *s="Golden Global View";
char *r="new";
int n;
clrscr();
n=strcspn(s,r);
printf("The first char both in s1 and s2 is: %c",s[n]);
getchar();
return 0;
}
</code></pre>相关函数:<a href="strpbrk.html">strpbrk</a>
<h1>字符串函数 - strcspn</h1>
<p>原型extern int strcspn(char *s1,char *s2);</p>
<p>用法:#include &lt;string.h></p>
<p>功能在字符串s1中搜寻s2中所出现的字符。</p>
<p>说明返回第一个出现的字符在s1中的下标值亦即在s1中出现而s2中没有出现的子串的长度。</p>
举例:<pre><code class="language-c">
// strcspn.c
#include &lt;syslib.h>
#include &lt;string.h>
main()
{
char *s="Golden Global View";
char *r="new";
int n;
clrscr();
n=strcspn(s,r);
printf("The first char both in s1 and s2 is: %c",s[n]);
getchar();
return 0;
}
</code></pre>相关函数:<a href="strpbrk.html">strpbrk</a>