📄 str.c
字号:
/** strings!** Nicholas Christopoulos, 5/5/2000** This program is distributed under the terms of the GPL v2.0 or later* Download the GNU Public License (GPL) from www.gnu.org*/#include "sys.h"#include "str.h"#include <stdarg.h>#include "panic.h"/**/void str_alltrim(char *str){ char *buf = tmp_alloc(strlen(str)+1); if ( *str == '\0' ) { tmp_free(buf); return; } if ( buf ) { char *p = buf; strcpy(buf, str); while ( *p == ' ' || *p == '\t' ) p ++; strcpy(str, p); p = str; while ( *p ) p ++; p--; while ( p >= str && (*p == ' ' || *p == '\t') ) p --; p++; *p = '\0'; tmp_free(buf); }}/***/char *str_istr(const char *s1, const char *s2){ char *p; int l2; p = (char *) s1; l2 = strlen(s2); while ( *p ) { if ( StrNCaselessCompare(p, s2, l2) == 0 ) return p; p ++; } return NULL;}/**/int is_alpha(int ch){ if ( ch == 0 ) return 0; if ( (ch > 64 && ch < 91) || (ch > 96 && ch < 123) ) return -1;// return (strchr("_谅媚牌侨墒颂臀闲延哉肿刭徕沅彐玷殛腱眍镳耋趱鲼
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -