|
From: | Christopher Lam |
Subject: | Re: [PATCH] Add string-split-substring |
Date: | Sun, 13 Feb 2022 03:28:02 +0000 |
Hello all,
I have added a function named `string-split-substring' to the (ice-9
string-fun) module. It acts like `string-split', but taking a substring
instead. It works like this
(string-replace-substring "item-1::item-2::item-3::item-4" "::")
=> ("item-1" "item-2" "item-3" "item-4")
The tests include all the edge cases in the tests for string-split, and
the behavior matches it exactly.
Documentation is also included in the patch.
I have found myself making and using this function numerous times, and
judging by IRC, others find it useful as well. The patch is attached.
~ Vijay
[Prev in Thread] | Current Thread | [Next in Thread] |