def to_lines(string, width):
    """Converts a string to lines of length <= width."""
    lines = []
    for i in range(0, len(string), width):
        lines.append(string[i:i + width])
    return lines
