erikivanmelo / incrstring

This a c library with a function recopilation for string manipulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

increased string

This a c library with a function recopilation for string manipulation

Functions

#define strempty(str) Returns 1 if the string is empty.

#define strew(str,ch) Returns 1 if the string ends with 'ch'.

#define strsw(str,ch) Returns 1 if the string starts with 'ch'.

#define strfpos(str,substr) Returns the position of the first occurrence of a string.

#define strlpos(str,substr) Returns the position of the first occurrence of a string.

#define strinsl(str,substr) Inserts a substring to the left of the string.

#define strinsr(str,substr) Inserts a substring to the right of the string.

#define strrst(str) Sets 0 in all index.

#define strtolwr(str) Converts uppercase to lowercase.

#define strtoopp(str) Converts lowercase to uppercase and uppercase to lowercase respectively.

#define strtoupr(str) Converts lowercase to uppercase.

#define strtrim(str) Removes spaces that are to the right and left of the string.

#define strtriml(str) Removes spaces that are to the left of the string.

#define strtrimr(str) Removes spaces that are to the right of the string.

#define strrvrs(str) Reverses the position of the characters in the string.

void strchins(char* str,int x,const char ch ) Inserts a character in a specific point.

void strchinsl(char* str,const char ch) Inserts a character to the left of the string.

void strchinsr(char* str,const char ch) Inserts a character to the right of the string.

int strcount(const char *str, const char *word) Returns the number of times a substring appears.

void strins(char* str,int x,const char* substr) Inserts a substring in a specific point.

int strposlr(const char *str,const char *substr, int i) Returns the first position of a substring analyzing it from left to right, starting from the incident 'i'.

int strposrl(char *str,const char *substr, int i) Returns the first position of a substring analyzing it from right to left, starting from the incident 'i'.

char strrem(char* str, int i) Removes the character from a string that is in a specific index.

void strrep(char *str,const char *a,const char *b) Replaces a substring with another substring.

void strfrep(char *str,const char *a,const char *b) Replaces the first occurrence of the substring with another substring

void strlrep(char *str,const char *a,const char *b) Replaces the last occurrence of the substring with another substring.

int strsplit(const char *str,const char *sep,const int w, char **arr) Separates a string based on a separator and save the result in a matrix. And return the number of substrings that resulted from that separation returns.

About

This a c library with a function recopilation for string manipulation

License:GNU General Public License v3.0


Languages

Language:C 100.0%