- avoid exposing an internal Split method inside blocks
- fix/test default delimiter +
remove_empty_fields
- performance improvements
- delegate to
String#split
where possible - use a regular class for Split rather than values.rb
- create Split objects directly rather than allocating intermediate hashes
- delegate to
String#split
incompatibility: we no longer trim the string (withString#strip
) before splitting if the delimiter is omitted
ss.split(str, " ")
is no longer treated the same asss.split(str)
i.e. unlike Ruby'sString#split
, the former no longer strips the string before splitting- rename the
remove_empty
optionremove_empty_fields
- rename the
exclude
optionexcept
(alias forreject
)
- add support for descending, negative, and infinite ranges,
e.g.
ss.split(str, ":", at: [..4, 4..., 3..1, -1..-3])
etc.
- correctly handle backreferences in delimiter patterns
- set StringSplitter::VERSION when
string_splitter.rb
is loaded
- add a
reject
/exclude
option which rejects splits at the specified positions - add a
select
alias forat
- don't treat string delimiters as patterns
- remove the
offset
alias forsplit.index
- remove trailing empty field when the separator is empty (#1)
- rename the
default_separator
optiondefault_delimiter
- make
index
(AKAoffset
) 0-based and addposition
(AKApos
) as the 1-based accessor
- the block now takes a single
split
object with anindex
accessor, rather than separateindex
andsplit
arguments
- add support for negative indices in the value supplied to the
at
option - add a
count
field to the split object containing the total number of splits
- initial release