Declaration of various helper functions for replacing characters or strings in a string. More...
Go to the source code of this file.
Macros | |
#define | __REPLACE_H__ |
Functions | |
void | replace_chr (char *s, char c1, char c2) |
Replace all occurrences of narrow character c1 with narrow character c2 in s , using case-sensitive search. If c2 is '\0' then all matches to c1 are effectively removed from the string. | |
void | replace_chri (char *s, char c1, char c2) |
Replace all occurrences of narrow character c1 with narrow character c2 in s , using case-insensitive search. If c2 is '\0' then all matches to c1 are effectively removed from the string. | |
char * | replace_str (const char *s, const char *str1, const char *str2) |
Replace all occurrences of narrow string str1 with narrow string str2 in s , using case-sensitive search, returning a new string. | |
char * | replace_stri (const char *s, const char *str1, const char *str2) |
Replace all occurrences of narrow string str1 with narrow string str2 in s , using case-insensitive search, returning a new string. | |
Declaration of various helper functions for replacing characters or strings in a string.
Definition in file helpers/replace.h.
#define __REPLACE_H__ |
Definition at line 8 of file helpers/replace.h.
void replace_chr | ( | char * | s, |
char | c1, | ||
char | c2 | ||
) |
Replace all occurrences of narrow character c1
with narrow character c2
in s
, using case-sensitive search. If c2
is '\0' then all matches to c1
are effectively removed from the string.
s | String to modify |
c1 | Character to replace |
c2 | Character to replace with |
Definition at line 17 of file replace.c.
Referenced by Composite_FileAccess_GetEntry().
void replace_chri | ( | char * | s, |
char | c1, | ||
char | c2 | ||
) |
Replace all occurrences of narrow character c1
with narrow character c2
in s
, using case-insensitive search. If c2
is '\0' then all matches to c1
are effectively removed from the string.
s | String to modify |
c1 | Character to replace |
c2 | Character to replace with |
char * replace_str | ( | const char * | s, |
const char * | str1, | ||
const char * | str2 | ||
) |
Replace all occurrences of narrow string str1
with narrow string str2
in s
, using case-sensitive search, returning a new string.
s | String to modify |
str1 | String to replace |
str2 | String to replace with (can be an empty string to remove str1 ). |
Definition at line 127 of file replace.c.
References _append_range().
Referenced by Command_Operation_Replace(), and Memento_Operation_Replace().
char * replace_stri | ( | const char * | s, |
const char * | str1, | ||
const char * | str2 | ||
) |
Replace all occurrences of narrow string str1
with narrow string str2
in s
, using case-insensitive search, returning a new string.
s | String to modify |
str1 | String to replace |
str2 | String to replace with (can be an empty string to remove str1 ). |
Definition at line 163 of file replace.c.
References _append_range(), and strstri().