def _extract_first_from_str(content: str) -> str:
    """Extract first line from str without splitting by line."""
    if not content:
        return content

    newline_pos = content.find("\n")
    if newline_pos == -1:
        return content
    return content[:newline_pos]