Selectively replace multiple instances of a character within a string: Difference between revisions

Content added Content deleted
(→‎Python: Added a further variant ( a map-accumulation ))
Line 518: Line 518:


Or, as a map-accumulation:
Or, as a map-accumulation:
<lang python>from functools import reduce
<lang python>'''Instance-specific character replacement rules'''

from functools import reduce