we got StdString in https://github.com/opdenkamp/xbmc-pvr-addons/blob/master/lib/platform/util/StdString.h which already supports replacing. please use that one to minimise dupe code