Documentation for method replace-with
assembled from the following pages:
Class: Match §
From Match
(Match) method replace-with §
Defined as:
multi method replace-with(Match: Str() --> Str)
Returns the invocant string where the Match
object is replaced by $replacement
.
my Str = "Some foo";my Match = .match(/foo/);my = .replace-with("string"); # «Some string»