C

String 함수

1. Include Header file

#include<string.h>

 

2. Function

2.1. 문자열 복사

char *strncpy(char *dest, const char *src, size_t n);
strcpy 함수 보완한 함수
char *strcpy(char *dest, const char *src);

2.2. 문자열 연결

char* strcat(char *dest, const char *src);
char* strncat(char *dest, const char *src, size_t n);

2.3. 문자열 비교

int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);

2.4. 문자열 검색

char *strchr(const char *s, int c);
size_t *strcspn(chst char *s, const char *reject);
size_t *strspn(const char *s, const char *accept);
char *strpbrk(const char *s, const char *accept);
char *strchr(const char *s, int c);
char *strrchr(const char *s, int c);
char *strstr(const char *s, const char *substring);
char *strtok(char *s, const char *delim);

Back To Top