{{task heading}}
Write a function or program that can split a string at each non-escaped occurrence of a separator character.
It should accept three input parameters:
:::* The string
:::* The separator character
:::* The escape character
It should output a list of strings.
{{task heading|Details}}
Rules for splitting:
* The fields that were separated by the separators, become the elements of the output list.
* Empty fields should be preserved, even at the start and end.
Rules for escaping:
* "Escaped" means preceded by an occurrence of the escape character that is not already escaped itself.
* When the escape character precedes a character that has no special meaning, it still counts as an escape (but does not do anything special).
* Each occurrence of the escape character that was used to escape something, should '''not''' become part of the output.
{{task heading|Test case}}
Demonstrate that your function satisfies the following test-case:
{| class="wikitable"
|-
! Input
! Output
|-
| style="vertical-align:top" |
{| style="border-collapse:collapse; border:none" border="0"
|-
| style="border:none; text-align:right" | string:
| style="border:none" |
one^|uno||three^^^^|four^^^|^cuatro||- | style="border:none; text-align:right" | separator character: | style="border:none" |
||- | style="border:none; text-align:right" | escape character: | style="border:none" |
^|} | {| style="border-collapse:collapse; border:none" border="0" |- | style="border:none" |
one|uno|- | style="border:none" | |- | style="border:none" |
three^^|- | style="border:none" |
four^|cuatro|- | style="border:none" | |} |} (Print the output list in any format you like, as long as it is it easy to see what the fields are.) {{Template:Strings}}