Skip to main content

splitlines

Function splitlines 

Source
pub fn splitlines<D: Dimension>(
    a: &StringArray<D>,
    keepends: bool,
) -> FerrayResult<StringArray2>
Expand description

Split each element on universal newlines (#515). Equivalent to numpy.strings.splitlines.

Returns a 2-D StringArray shaped (n_inputs, max_lines) with trailing empty padding when the per-element line count differs. keepends = true retains the line terminator on each kept line, matching Python/NumPy behavior.

ยงErrors

Returns an error if array construction fails.