I am working on a project in clojure that can interact with any Java classes, so the answer to my question can be for both java and clojure.
Basically, I need to be able to split the string into components based on the given separator (which will be more than one character), but at the same time keep the separators.
For example:
splitting "test:test:test" on ":" => [ "test" ":" "test" ":" "test" ] splitting "::test::test::" on "::" => [ "::" "test" "::" "test" "::" ]
The cabinets I used use clojure clojure.string/split , but in reality they do not return separators. The second closest is the use of a StringTokenizer that returns separators but does not accept multi-character separators.
Does anyone know any solutions, moreover, just breaking a string into a sequence of characters and running a weird shortcut on it?
Mediocre gopher
source share