added one line if(...) - with this line stri_split works like strsplit (omits last empty element).