Hi,
Does anyone have a general purpose C string substitute function . I have tried it with strtok but failed.
The function could be of the form
char *sub_string(char *the_string, char *find, char *replace);
returning a string with the substitution of find for replace.
eg. char *str = "The quick brown fox";
char *new_str = "";
new_str = sub_string(str, "fox", "dog"
Does anyone have a general purpose C string substitute function . I have tried it with strtok but failed.
The function could be of the form
char *sub_string(char *the_string, char *find, char *replace);
returning a string with the substitution of find for replace.
eg. char *str = "The quick brown fox";
char *new_str = "";
new_str = sub_string(str, "fox", "dog"