@staticmethod
def func_substitute(header, lines):
    """Returns modified lines and whether string changed.

        Keyword arguments:
        header -- Header object
        lines -- file contents string

        Returns modified file contents string
        """
    pos = 0
    while pos < len(lines):
        old_length = len(lines)
        match = header.func_regex.search(lines, pos)
        if not match:
            break
        pos = match.start(1) + len(header.prefix) + len(match.group(1))
        if match.group(1) in header.func_names:
            lines = lines[0:match.start(1)] + header.prefix + match.group(1
                ) + lines[match.end(1):]
    return lines
