SDDSlib
|
Provides functions to replace occurrences of substrings within strings. More...
#include "mdb.h"
Go to the source code of this file.
Functions | |
int | replace_string (char *t, char *s, char *orig, char *repl) |
Replace all occurrences of one string with another string. | |
int | replace_stringn (char *t, char *s, char *orig, char *repl, long count_limit) |
Replace a limited number of occurrences of one string with another string. | |
int | replaceString (char *t, char *s, char *orig, char *repl, long count_limit, long here) |
Replace occurrences of one string with another string with additional options. | |
Provides functions to replace occurrences of substrings within strings.
Definition in file replace_string.c.
int replace_string | ( | char * | t, |
char * | s, | ||
char * | orig, | ||
char * | repl ) |
Replace all occurrences of one string with another string.
This function replaces all instances of the substring orig
in the source string s
with the substring repl
, and stores the result in the destination string t
.
t | Destination string where the result is stored. |
s | Source string in which replacements are to be made. |
orig | The substring to be replaced. |
repl | The substring to replace with. |
Definition at line 29 of file replace_string.c.
int replace_stringn | ( | char * | t, |
char * | s, | ||
char * | orig, | ||
char * | repl, | ||
long | count_limit ) |
Replace a limited number of occurrences of one string with another string.
This function replaces up to count_limit
instances of the substring orig
in the source string s
with the substring repl
, and stores the result in the destination string t
.
t | Destination string where the result is stored. |
s | Source string in which replacements are to be made. |
orig | The substring to be replaced. |
repl | The substring to replace with. |
count_limit | The maximum number of replacements to perform. |
Definition at line 46 of file replace_string.c.
int replaceString | ( | char * | t, |
char * | s, | ||
char * | orig, | ||
char * | repl, | ||
long | count_limit, | ||
long | here ) |
Replace occurrences of one string with another string with additional options.
This function replaces instances of the substring orig
in the source string s
with the substring repl
, up to a maximum of count_limit
replacements. The here
parameter controls additional replacement behavior. The result is stored in the destination string t
.
t | Destination string where the result is stored. |
s | Source string in which replacements are to be made. |
orig | The substring to be replaced. |
repl | The substring to replace with. |
count_limit | The maximum number of replacements to perform. If negative, no limit is applied. |
here | Additional parameter to control replacement behavior. |
Definition at line 65 of file replace_string.c.