Closed Gleefre closed 10 months ago
Hello,
For something similar I often split by a character and take the first part:
(first (str:split +comment-char+ line))
(first (str:split "#" "hello # comment" ))
;; "hello"
However by "commented out" I think "programming or markup language", and I fear this would be out of scope for this library.
What to do with a line (insert "# title") # comment
?
It would work for sure, but it is doing a lot of extra work (it splits the whole string, creates a new list that ends up unused).
"Commented out" part is for a very simple text format that can't contain #
anywhere except for comments (it deals with numbers and symbols, can't have arbitrary strings)
If you think it is out of scope for this library - of course I don't insist, feel free to close the issue :)
Hello!
I stumbled upon a simple operation that is somewhat tedious to write manually and hopefully can be of interest to this library. I can't come up with a name though :(
The idea is simple - remove "commented out" part of the string: