uTools-Manuals/docs/c/isspace.html
2019-04-08 23:22:26 +08:00

37 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1>字符函数 - isspace</h1>
<p>原型extern int isspace(int c);</p>
<p>用法:#include &lt;ctype.h></p>
<p>功能判断字符c是否为空白符</p>
<p>说明当c为空白符时返回非零值否则返回零。</p>
   空白符指空格、水平制表、垂直制表、换页、回车和换行符。
举例:<pre>
// isspace.c
#include &lt;syslib.h>
#include &lt;ctype.h>
main()
{
char s[]="Test Line 1\tend\nTest Line 2\r";
int i;
clrscr(); // clear screen
for(i=0;i&lt;strlen(s);i++)
{
if(isspace(s[i])) putchar('.');
else putchar(s[i]);
}
getchar();
return 0;
}
</pre>相关函数:<a href="isalnum.html">isalnum</a>,<a href="isalpha.html">isalpha</a>,<a href="isdigit.html">isdigit</a>,<a href="isxdigit.html">isxdigit</a>,<a href="iscntrl.html">iscntrl</a>,<a href="isgraph.html">isgraph</a>,<a href="isprint.html">isprint</a>,<a href="ispunct.html">ispunct</a>