Does Clojure have a Split function that splits the String into sub-strings including the separator? Like "a=b", separator "=" return: "a", "=", 'b". thanks!
i find regexp to be the simplest variant:
user> (re-seq #"[^=]+|=" "asd=dfg=hgf=jjj")
;;=> ("asd" "=" "dfg" "=" "hgf" "=" "jjj")
user> (re-seq #"[^=]+|=" "asd=dfg=hgf=")
;;=> ("asd" "=" "dfg" "=" "hgf" "=")
user> (re-seq #"[^=]+|=" "=dfg=hgf=dffff")
;;=> ("=" "dfg" "=" "hgf" "=" "dffff")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With