結果 : get string before last occurrence of character python