user
Determine if a character string is   *squeezable*.

And if so,   squeeze the string   (by removing any number of
a   *specified*   *immediately repeated*   character).

This task is very similar to the task     **Determine if a character string is collapsible**     except
that only a specified character is   *squeezed*   instead of any character that is *immediately repeated*.

If a character string has a specified   *immediately repeated*   character(s),   the repeated characters are to be
deleted (removed),   but not the primary (1st) character(s).

A specified   *immediately repeated*   character is any specified character that is   immediately  
followed by an identical character (or characters).   Another word choice could've been   *duplicated*
character*,   but that might have ruled out   (to some readers)   triplicated characters   ···   or more.*

{This Rosetta Code task was inspired by a newly introduced   (as of around
November 2019)   **PL/I**   BIF:   **squeeze**.}

Examples

In the following character string with a specified   *immediately repeated*   character of   **e**:

```
 The better the 4-wheel drive, the further you'll be from help when ya get stuck! 

```

Only the 2nd   **e**   is an specified repeated character,   indicated by an underscore
(above),   even though they (the characters) appear elsewhere in the character string.

So, after *squeezing* the string, the result would be:

```
 The better the 4-whel drive, the further you'll be from help when ya get stuck! 

```

Another example:
In the following character string,   using a specified immediately repeated character   **s**:

```
 headmistressship 

```

The "squeezed" string would be:

```
 headmistreship 

```

Task

Write a subroutine/function/procedure/routine···   to locate a   *specified immediately repeated*   character
and   *squeeze*   (delete)   them from the character string.   The
character string can be processed from either direction.

Show all output here, on this page:

:   * the   specified repeated character   (to be searched for and possibly *squeezed*):
    * the   original string and its length
    * the resultant string and its length
    * the above strings should be "bracketed" with   **<<<**   and   **>>>**   (to delineate blanks)
    * «««Guillemets may be used instead for "bracketing" for the more artistic programmers,   shown used here»»»

Use (at least) the following five strings,   all strings are length seventy-two (characters, including blanks),   except
the 1st string:

```
                                                                                  immediately
 string                                                                            repeated
 number                                                                            character
                                                                                     ( ↓   a blank,  a minus,  a seven,  a period)
        ╔╗
   1    ║╚═══════════════════════════════════════════════════════════════════════╗    ' '    ◄■■■■■■  a null string  (length zero)
   2    ║"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln ║    '-'
   3    ║..1111111111111111111111111111111111111111111111111111111111111117777888║    '7'
   4    ║I never give 'em hell, I just tell the truth, and they think it's hell. ║    '.'
   5    ║                                                    --- Harry S Truman  ║  (below)  ◄■■■■■■  has many repeated blanks
        ╚════════════════════════════════════════════════════════════════════════╝     ↑
                                                                                       │
                                                                                       │
        For the 5th string  (Truman's signature line),  use each of these  specified immediately  repeated characters:
                                  •  a blank
                                  •  a minus
                                  •  a lowercase  r

```

Note:   there should be seven results shown,   one each for the 1st four strings,   and three results for
the 5th string.

Other tasks related to string operations:

Metrics

* Array length
* String length
* Copy a string
* Empty string  (assignment)

Counting

* Word frequency
* Letter frequency
* Jewels and stones
* I before E except after C
* Bioinformatics/base count
* Count occurrences of a substring
* Count how many vowels and consonants occur in a string

Remove/replace

* XXXX redacted
* Conjugate a Latin verb
* Remove vowels from a string
* String interpolation (included)
* Strip block comments
* Strip comments from a string
* Strip a set of characters from a string
* Strip whitespace from a string -- top and tail
* Strip control codes and extended characters from a string

Anagrams/Derangements/shuffling

* Word wheel
* ABC problem
* Sattolo cycle
* Knuth shuffle
* Ordered words
* Superpermutation minimisation
* Textonyms (using a phone text pad)
* Anagrams
* Anagrams/Deranged anagrams
* Permutations/Derangements

Find/Search/Determine

* ABC words
* Odd words
* Word ladder
* Semordnilap
* Word search
* Wordiff  (game)
* String matching
* Tea cup rim text
* Alternade words
* Changeable words
* State name puzzle
* String comparison
* Unique characters
* Unique characters in each string
* Extract file extension
* Levenshtein distance
* Palindrome detection
* Common list elements
* Longest common suffix
* Longest common prefix
* Compare a list of strings
* Longest common substring
* Find common directory path
* Words from neighbour ones
* Change e letters to i in words
* Non-continuous subsequences
* Longest common subsequence
* Longest palindromic substrings
* Longest increasing subsequence
* Words containing "the" substring
* Sum of the digits of n is substring of n
* Determine if a string is numeric
* Determine if a string is collapsible
* Determine if a string is squeezable
* Determine if a string has all unique characters
* Determine if a string has all the same characters
* Longest substrings without repeating characters
* Find words which contains all the vowels
* Find words which contain the most consonants
* Find words which contains more than 3 vowels
* Find words whose first and last three letters are equal
* Find words with alternating vowels and consonants

Formatting

* Substring
* Rep-string
* Word wrap
* String case
* Align columns
* Literals/String
* Repeat a string
* Brace expansion
* Brace expansion using ranges
* Reverse a string
* Phrase reversals
* Comma quibbling
* Special characters
* String concatenation
* Substring/Top and tail
* Commatizing numbers
* Reverse words in a string
* Suffixation of decimal numbers
* Long literals, with continuations
* Numerical and alphabetical suffixes
* Abbreviations, easy
* Abbreviations, simple
* Abbreviations, automatic

Song lyrics/poems/Mad Libs/phrases

* Mad Libs
* Magic 8-ball
* 99 bottles of beer
* The Name Game (a song)
* The Old lady swallowed a fly
* The Twelve Days of Christmas

Tokenize

* Text between
* Tokenize a string
* Word break problem
* Tokenize a string with escaping
* Split a character string based on change of character

Sequences

* Show ASCII table
* De Bruijn sequences
* Summarize and say sequence
* Generate lower case ASCII alphabet
assistant
(formerly Perl 6)

**Works with**: Rakudo version 2019.07.1

```
map {
    my $squeeze = $^phrase;
    sink $^reg;
    $squeeze ~~ s:g/($reg)$0+/$0/;
    printf "\nOriginal length: %d <<<%s>>>\nSqueezable on \"%s\": %s\nSqueezed length: %d <<<%s>>>\n",
      $phrase.chars, $phrase, $reg.uniname, $phrase ne $squeeze, $squeeze.chars, $squeeze
},  
  '', ' ', 
  '"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln ', '-',
  '..1111111111111111111111111111111111111111111111111111111111111117777888', '7',
  "I never give 'em hell, I just tell the truth, and they think it's hell. ", '.',
  '                                                    --- Harry S Truman  ', ' ',
  '                                                    --- Harry S Truman  ', '-',
  '                                                    --- Harry S Truman  ', 'r'

```

Output:

```
Original length: 0 <<<>>>
Squeezable on "SPACE": False
Squeezed length: 0 <<<>>>

Original length: 72 <<<"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln >>>
Squeezable on "HYPHEN-MINUS": True
Squeezed length: 70 <<<"If I were two-faced, would I be wearing this one?" - Abraham Lincoln >>>

Original length: 72 <<<..1111111111111111111111111111111111111111111111111111111111111117777888>>>
Squeezable on "DIGIT SEVEN": True
Squeezed length: 69 <<<..1111111111111111111111111111111111111111111111111111111111111117888>>>

Original length: 72 <<<I never give 'em hell, I just tell the truth, and they think it's hell. >>>
Squeezable on "FULL STOP": False
Squeezed length: 72 <<<I never give 'em hell, I just tell the truth, and they think it's hell. >>>

Original length: 72 <<<                                                    --- Harry S Truman  >>>
Squeezable on "SPACE": True
Squeezed length: 20 <<< --- Harry S Truman >>>

Original length: 72 <<<                                                    --- Harry S Truman  >>>
Squeezable on "HYPHEN-MINUS": True
Squeezed length: 70 <<<                                                    - Harry S Truman  >>>

Original length: 72 <<<                                                    --- Harry S Truman  >>>
Squeezable on "LATIN SMALL LETTER R": True
Squeezed length: 71 <<<                                                    --- Hary S Truman  >>>

```