Replace legacy string functions