# input my $input = 'r k r'; # desired output: my $output = 'r3k2r'; [download]
In reply to How can I replace space sequences in a string with the number of spaces in each sequence? by tkguifan