Function str_split_escaped

Source
pub fn str_split_escaped(input: &str, separator: &str) -> Vec<String>
Expand description

Escape-aware split:

Original logic (strSplitEscaped):

  • First performs a plain split.
  • Iterates segments; if a segment ends with a backslash (escape char) and there is a following segment, it replaces the trailing backslash with the separator and concatenates the next segment to it, continuing (effectively treating the separator as a literal).
  • A dangling trailing backslash (no following segment) is preserved as-is.