public static function fromString($string)
    {
        try {
            $lineBreak = StringUtil::detectLineBreak($string);
        } catch (DifferentLineBreaksFoundException $e) {
            $lineBreak = $e->getNumberLineBreakOther() >= $e->getNumberLineBreakWindows()
                ? StringUtil::LINE_BREAK_OTHER
                : StringUtil::LINE_BREAK_WINDOWS;
        }

        return new static(StringUtil::breakIntoLines($string), $lineBreak);
    }