c 判断是否为 字母或数字(iswalnum example)
#include <stdio.h> #include <wctype.h> int main () { int i; wchar_t str[] = L"c3p。o..."; i=0; while (iswalnum(str[i])){ i++; } printf("The first %d characters are alphanumeric.\n",i); return 0; }
输出
The first 3 characters are alphanumeric.