Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue