Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,22 @@
using Printf
function striplinecomment(a::String, cchars::String="#;")
b = strip(a)
0 < length(cchars) || return b
for c in cchars
r = Regex(@sprintf "\\%c.*" c)
b = replace(b, r => "")
end
strip(b)
end
tests = ("apples, pears # and bananas",
"apples, pears ; and bananas",
" apples, pears & bananas ",
" # ")
for t in tests
s = striplinecomment(t)
println("Testing \"", t, "\":")
println(" \"", s, "\"")
end