http://qs1969.pair.com?node_id=836073


in reply to Insert comma after every character

So, you have "F", "B", a space, "D" and want to turn that into "F", comma, space, "B", comma, space, "D"? The simplest way is:
$str = "F, B, D" if $str eq "FB D";
Are we free to generalize this? Here's a broad generalization:
$str = "F, B, D";
Or do you want something else? Perhaps you can describe it, instead of assume we're all omniscient, and can deduce what you want from a single example, and some botched code.