def remove_comments(lines):
    """Remove lines in a string list that start with # and content after #."""
    processed_lines = []
    for line in lines:
        line = line.strip()
        if not line or line[0] == '#':
            continue
        if '#' in line:
            line = line[0:line.index('#')]
        processed_lines.append(line)
    return processed_lines
