Implement STRRPL

Fixes #660

STRRPL(str, "", new) does nothing
(warn about it with -Wempty-strrpl)
This commit is contained in:
Rangi
2020-12-30 11:00:44 -05:00
committed by Eldred Habert
parent 669a392fcd
commit 77279984a5
10 changed files with 88 additions and 13 deletions

View File

@@ -374,6 +374,7 @@ Most of them return a string, however some of these functions actually return an
.It Fn STRSUB str pos len Ta Returns a substring from Ar str No starting at Ar pos Po first character is position 1 Pc and Ar len No characters long.
.It Fn STRUPR str Ta Returns Ar str No with all letters in uppercase.
.It Fn STRLWR str Ta Returns Ar str No with all letters in lowercase.
.It Fn STRRPL str old new Ta Returns Ar str No with each non-overlapping occurrence of the substring Ar old No replaced with Ar new .
.It Fn STRFMT fmt args... Ta Returns the string Ar fmt No with each
.Ql %spec
pattern replaced by interpolating the format