diff options
Diffstat (limited to 'src/helper_functions.c')
| -rw-r--r-- | src/helper_functions.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/helper_functions.c b/src/helper_functions.c index c1931fd..162cf45 100644 --- a/src/helper_functions.c +++ b/src/helper_functions.c @@ -16,6 +16,22 @@ void *malloce(size_t size){ return mal; } +char *pop(char *token, int ch_i){ + if(token[ch_i]=='\0'){ + return token; + } + + char *right=(char*)malloce(sizeof(char)*strlen(token)+1); + + strcpy(right,&token[ch_i+1]); + token[ch_i]='\0'; + strcat(token,right); + + free(right); + return token; +} + + // You must free the result if result is non-NULL. char *str_replace(char *orig, char *rep, char *with) { char *result; // the return string |
