To add to AppleFritter’s excellent explanation:
The only reason split is giving you the contents of the separators is that you have capturing parentheses in your regex. From split:
If the PATTERN contains capturing groups, then for each separator, an additional field is produced for each substring captured by a group...
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: How to split a string based on character(s) length
by Athanasius
in thread How to split a string based on the length of a sequence of characters within the string
by thanos1983
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |