Anonymous user
Determine if a string is squeezable: Difference between revisions
Determine if a string is squeezable (view source)
Revision as of 19:12, 29 November 2019
, 4 years ago→{{header|REXX}}: corrected an input data field in the REXX program and it's corresponding output.
(→{{header|REXX}}: removed bogus flagging as all five strings were indeed used, with eight results as per the task's requirements.) |
m (→{{header|REXX}}: corrected an input data field in the REXX program and it's corresponding output.) |
||
Line 423:
#.1= ' '; @.1=
#.2= '-'; @.2= '"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln '
#.3= '7'; @.3= ..
#.4= . ; @.4= "I never give 'em hell, I just tell the truth, and they think it's hell. "
#.5= ' '; @.5= ' --- Harry S Truman '
Line 432:
say copies('═', 105) /*show a separator line between outputs*/
if j>1 & L==0 then leave /*if arg is null and J>1, then leave. */
say ' specified immediate repeatable
say ' length='right(L, 3) " input=«««" || @.j || '»»»'
new= squeeze(@.j, #.j)
Line 452:
<pre>
═════════════════════════════════════════════════════════════════════════════════════════════════════════
specified immediate repeatable
length= 0 input=«««»»»
length= 0 output=«««»»»
═════════════════════════════════════════════════════════════════════════════════════════════════════════
specified immediate repeatable
length= 72 input=«««"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln »»»
length= 70 output=«««"If I were two-faced, would I be wearing this one?" - Abraham Lincoln »»»
═════════════════════════════════════════════════════════════════════════════════════════════════════════
specified immediate repeatable
length= 72 input=«««..
length=
═════════════════════════════════════════════════════════════════════════════════════════════════════════
specified immediate repeatable
length= 72 input=«««I never give 'em hell, I just tell the truth, and they think it's hell. »»»
length= 72 output=«««I never give 'em hell, I just tell the truth, and they think it's hell. »»»
═════════════════════════════════════════════════════════════════════════════════════════════════════════
specified immediate repeatable
length= 72 input=««« --- Harry S Truman »»»
length= 20 output=««« --- Harry S Truman »»»
═════════════════════════════════════════════════════════════════════════════════════════════════════════
specified immediate repeatable
length= 72 input=««« --- Harry S Truman »»»
length= 70 output=««« - Harry S Truman »»»
═════════════════════════════════════════════════════════════════════════════════════════════════════════
specified immediate repeatable
length= 72 input=««« --- Harry S Truman »»»
length= 71 output=««« --- Hary S Truman »»»
|