def METHOD_NAME(self, varname, setvar = True):
    var = self.d.getVar(varname)
    if not var:
        return ""
    var = var.split()
    newvar = []
    for v in var:
        if v.startswith("^" + self.extname):
            newvar.append(v)
        elif v.startswith("^"):
            newvar.append("^" + self.extname + "-" + v[1:])
        else:
            newvar.append(self.extend_name(v))
    newdata =  " ".join(newvar)
    if setvar:
        self.d.setVar(varname, newdata)
    return newdata