Determine if a string is collapsible: Difference between revisions
Content added Content deleted
Line 411: | Line 411: | ||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
There is already a builtin we can abuse for this. The documentation of unique() [added for 0.8.1] states:<br> |
There is already a builtin we can abuse for this. The documentation of unique() [added for 0.8.1] states:<br> |
||
`If "PRESORTED" is specified, but s is not actually sorted, then only adjacent duplicates are removed.` |
`If "PRESORTED" is specified, but s is not actually sorted, then only adjacent duplicates are removed.`<br> |
||
If you don't have builtins/punique.e to hand, you may want to take a quick look at squeeze() in |
|||
[[https://rosettacode.org/wiki/Determine_if_a_string_is_squeezable#Phix]], but obviously w/o ch. |
|||
<lang Phix>constant tests = {"", |
<lang Phix>constant tests = {"", |
||
`"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln `, |
`"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln `, |