Skip to main content

partition

Function partition 

Source
pub fn partition<D: Dimension>(
    a: &StringArray<D>,
    sep: &str,
) -> FerrayResult<Vec<(String, String, String)>>
Expand description

Split each element on the first occurrence of sep, returning a (before, sep, after) triple per element.

If sep is not found in an element, the result is (element, "", ""). Mirrors numpy.strings.partition.

ยงErrors

  • FerrayError::InvalidValue if sep is empty.