Remove string in python dictionary value

import re

new_d = {key: re.sub('^.*/', '', val) for key, val in d.iteritems()}

Leave a Comment