Determine if a string is collapsible: Difference between revisions

Content added Content deleted
(Added Go)
(→‎{{header|Perl 6}}: Add a Perl 6 example)
Line 228: Line 228:
end
end
</lang>
</lang>

=={{header|Perl 6}}==
{{works with|Rakudo|2019.07.1}}

<lang perl6>map {
my $squish = .comb.squish.join;
printf "\nLength: %2d <<<%s>>>\nLength: %2d <<<%s>>>\n", .chars, $_, $squish.chars, $squish
}, lines

qq:to/STRINGS/;

"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln
..1111111111111111111111111111111111111111111111111111111111111117777888
I never give 'em hell, I just tell the truth, and they think it's hell.
--- Harry S Truman
STRINGS</lang>
{{out}}
<pre>Length: 0 <<<>>>
Length: 0 <<<>>>

Length: 72 <<<"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln >>>
Length: 70 <<<"If I were two-faced, would I be wearing this one?" - Abraham Lincoln >>>

Length: 72 <<<..1111111111111111111111111111111111111111111111111111111111111117777888>>>
Length: 4 <<<.178>>>

Length: 72 <<<I never give 'em hell, I just tell the truth, and they think it's hell. >>>
Length: 69 <<<I never give 'em hel, I just tel the truth, and they think it's hel. >>>

Length: 72 <<< --- Harry S Truman >>>
Length: 17 <<< - Hary S Truman >>>
</pre>


=={{header|REXX}}==
=={{header|REXX}}==