You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/Type/Str.pod
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -684,7 +684,15 @@ Example:
684
684
685
685
=head2method trans
686
686
687
-
Replaces one or many substrings with one or many strings. Ranges are supported, both for keys and values. Regexes work as keys. When called with C<:complemet> anything but the matched value or range is replaced with a single value. With C<:delete> the matched characters are removed. Combining C<:complement> and C<:delete> will remove anything but the mached values. The adverb C<:squash> will reduce repeated matched characters to a single character.
687
+
proto method trans(|) { $/ := nqp::getlexcaller('$/'); {*} }
688
+
multi method trans(Str:D: Pair:D \what, *%n) returns Str
689
+
multi method trans(Str:D: *@changes, :complement(:$c), :squash(:$s), :delete(:$d)) returns Str
690
+
691
+
Replaces one or many substrings with one or many strings. Ranges are supported, both for keys and
692
+
values. Regexes work as keys. When called with C<:complement> anything but the matched value or range
693
+
is replaced with a single value. With C<:delete> the matched characters are removed.
694
+
Combining C<:complement> and C<:delete> will remove anything but the mached values.
695
+
The adverb C<:squash> will reduce repeated matched characters to a single character.
0 commit comments