I need to separate any digraphs in a string, that consist of 2 letters the same, by inserting an 'X' between them. _2 ]\ 'THEEQUICKBROWFFOX' TH EE QU IC KB RO WF FO X
'EE' is a digraph that needs an 'X' inserted. Doing so will result in: TH EX EQ UI CK BR OW FF OX So now we also need to separate the 'FF' digraph. I want to define a verb "dedouble" that will process a string so: dedouble 'THEEQUICKBROWFFOX' THEXEQUICKBROWFXFOX But: dedouble 'THEEQUICKBROWFOOX' THEXEQUICKBROWFOOX I have implemented a solution at https://rosettacode.org/wiki/Playfair_cipher#J but am interested in alternative implementations. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm