Skip to content

Instantly share code, notes, and snippets.

Created October 8, 2010 17:27
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 anonymous/617162 to your computer and use it in GitHub Desktop.
Save anonymous/617162 to your computer and use it in GitHub Desktop.
pmichaud@plum:~/rakudo$ cat ss
sub samespace($str, $other) {
my @new = ($other.comb(/\s+/), '');
($str.split(/\s+/, @new) Z @new).join('')
}
say samespace('a b c d', "x\ty\r\nz");
pmichaud@plum:~/rakudo$ ./perl6 ss
a b
c d
pmichaud@plum:~/rakudo$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment