in reply to substitution

Time to transliterate!
$str =~ tr/01/LH/;

HTH

broquaint