def _cut_string(string: str, from_line: int, to_line: int, from_col: int, to_col: int):
    """Cut a string and return the resulting substring.

    Example:

        Given a *string*,

        "xxxxxxxxxxx
         xxxxxAXXXXXXXXXXXXXXXXXXXX
         XXXXXXXXXXXXXBxxxx
         xxxx"

        , to cut a substring from *A* to *B*, give as *from_line* the line of *A* (1) and *to_line*
        the line of *B* (2). *from_col* determines the position of *A* within the line (5) and
        *to_col* determines the position of *B* (13).
        The result would be:

        "AXXXXXXXXXXXXXXXXXXXX
         XXXXXXXXXXXXXB"

    :param string: The input string.
    :param from_line: The first line to include.
    :param to_line: The last line to include.
    :param from_col: The first col on *from_line* to include.
    :param to_col: The last col on *to_line* to include.
    :returns: The cut-out string.
    """
    lines = string.split('\n')[from_line: to_line + 1]
    if len(lines) == 1:
        return lines[0][from_col:to_col]
    lines[0] = lines[0][from_col:]
    lines[-1] = lines[-1][:to_col]
    return '\n'.join(lines)