Get the left side of a string separated by a fragment

string strleft(string str, string substr, bool isfromlast=false);


If isfromlast is specified and it is true, then if there are several fragments, consider the last fragment as a separator.