String replace

This patch was lying on batteries-devel for almost a year.