JanetDocsSourcePlaygroundI'm feeling luckyCommunityGitHub sign in

string/replace

core-api


    cfunction
    src/core/string.c on line 386, column 1

    (string/replace patt subst str)

    Replace the first occurrence of `patt` with `subst` in the string 
    `str`. If `subst` is a function, it will be called with `patt` only 
    if a match is found, and should return the actual replacement text 
    to use. Will return the new string if `patt` is found, otherwise 
    returns `str`.


1 exampleSign in to add an example
Loading...
(string/replace "+" "-" "ctrl+c")
# => "ctrl-c"
sogaiuPlayground