Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created May 26, 2012 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadzik/2795109 to your computer and use it in GitHub Desktop.
Save tadzik/2795109 to your computer and use it in GitHub Desktop.
my $s := " ";
my $text := "foo\n bar\n baz";
my $n := subst($text, /\n$s/, "", :global);
say("'$n'");
@tadzik
Copy link
Author

tadzik commented May 26, 2012

Result:

'foo
 bar
  baz'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment