2004년 3월 9일 화요일

glibc에 case-insensitive한 matching

http://www.gnu.org/software/libc/manual/html_mono/libc.html#Case%20Conversion

char * strcasestr (const char *haystack, const char *needle)  Function

This is like strstr, except that it ignores case in searching for the substring. Like strcasecmp, it is locale dependent how uppercase and lowercase characters are related.
For example,


strstr ("hello, world", "L")
    => "llo, world"
strstr ("hello, World", "wo")
    => "World"

---------------------
strcasestr 함수가 없다고 나올때는 #define _GNU_SOURCE 1 이라고 적을 것

댓글 없음:

댓글 쓰기