def get_end_index_of_a_paragraph_from_string(text, start=0):
    """

        :param text: a string
        :param start: the index of the start position
        :return: the index of the new line character or the last character
    """
    return min(len(text) - 1, text.find('\n', start))