java split string into two based on last occurrence of a separator code example Example: python split only last occurrence of a character s.rsplit(',', 1) s.rpartition(',')