# xarray.DataArray.str.rpartition

#### DataArray.str.rpartition(dim, sep=' ')[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/accessor_str.py#L2459-L2495)

Split the strings in the DataArray at the last occurrence of separator sep.

This method splits the string at the last occurrence of sep,
and returns 3 elements containing the part before the separator,
the separator itself, and the part after the separator.
If the separator is not found, return 3 elements containing two empty strings,
followed by the string itself.

If sep is array-like, it is broadcast against the array and applied
elementwise.

* **Parameters:**
  * **dim** ([hashable](../user-guide/terminology.html.md#term-name) or [`None`](https://docs.python.org/3/builtins/constants.html#None)) – Name for the dimension to place the 3 elements in.
    If None, place the results as list elements in an object DataArray.
  * **sep** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str) or [`bytes`](https://docs.python.org/3/builtins/stdtypes.html#bytes) or [array-like](https://numpy.org/doc/stable/glossary.html#term-array_like), *default*: `" "`) – String to split on.
    If array-like, it is broadcast.
* **Returns:**
  **rpartitioned** (`same type as values` or `object array`)

#### SEE ALSO
[`DataArray.str.partition`](xarray.DataArray.str.partition.html.md#xarray.DataArray.str.partition), [`str.rpartition`](https://docs.python.org/3/builtins/stdtypes.html#str.rpartition), [`pandas.Series.str.rpartition`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.rpartition.html#pandas.Series.str.rpartition)
