Date: 2010-06-03 15:35:39 +0200 (Thu, 03 Jun 2010)
New Revision: 31081
[S32/Str] proposed Str.indent
Following an idea bounced around on #perl6, this method was added.
--- docs/Perl6/Spec/S32-setting-library/Str.pod 2010-06-03 13:07:35 UTC (rev
+++ docs/Perl6/Spec/S32-setting-library/Str.pod 2010-06-03 13:35:39 UTC (rev
@@ -583,6 +583,20 @@
our multi trans(List of Pair %data);
+ our Str multi method indent ($str: $steps) is export;
+Returns a re-indented string wherein C<$steps> number of spaces have been added
+to each line (i.e. to the beginning of the string and after each logical
+If C<$steps> is negative, removes that many spaces instead. Should any line
+contain too few leading spaces, only those are removed and a warning is issued.
+Only spaces are considered indentation; tabs or other Unicode whitespace
+characters are not considered.