Add function string_replace_all[_str]

to replace all occurences of a string by another.
This commit is contained in:
Patrick Pelissier committed 2020-11-22 23:04:32 +01:00
1 parent 0b9e27fb7f
commit 55e7b3083a
3 files changed
+168

No files matched your search

+6
View File
@@ -5079,6 +5079,12 @@ the string 'str1' by the string 'str2' once.
Returns the offset of the replacement or STRING_FAILURE if no replacement
was performed.
##### size\_t string\_replace\_all\_str (string\_t v, const char str1[], const char str2[])
##### size\_t string\_replace\_all (string\_t v, const string\_t str1, const string\_t str2)
Replace in the string 'v' all the occurences of
the string 'str1' by the string 'str2'.
##### void string\_replace\_at (string\_t v, size\_t pos, size\_t len, const char str2[])
Replace in the string 'v' the sub-string defined as starting from 'pos' and