What are the most commonly used & useful string functions in C?
string functions
String manipulation in C
Proper way to return a String from a function?
Videos
As there are a lot of string manipulation functions, what are note-worthy?
Hi guys!
I know y'all probably already have your own functions written for this kind of stuff or already have your favorite lib, but if you do not or if you do not mind given your thoughts and opinions, please, check my project out. It's a library / header with some functions for manipulating strings inspired in the Oracle PL/SQL functions. Functions the lib already have:
char *replace(char *string, char *oldChar, char *newChar);
char *rpad(char *string, char *padString, int paddedLength);
char *substr(char *string, int ini, int end);
int indexOf(char *string, char *keyword, int *start, int *end);
This is totally an amateur project, made to study, never used in production.
I saw some big libraries with some functions like this, but they work with structs instead of array of characters. I think they have their reasons, but I wanted something simple so I made this. The fact that I use int and char* probably will result in compatibility issues, but I do not quite understand this yet so I'll leave it at it.
Anyway, this is the link for the source code: https://github.com/crocarneiro/libstring-utils
You can download the source and compile it yourself or if you prefer you can install the lib in your linux system and then just link the library in your projects with the flag -lstring-utils.
I appreciate any opinion you can give me. That's all folks.