Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
import strutils
|
||||
|
||||
proc removeComments(line: string; sep: char): string =
|
||||
line.split(sep)[0].strip(leading = false)
|
||||
|
||||
const
|
||||
Str1 = "apples, pears # and bananas"
|
||||
Str2 = "apples, pears ; and bananas"
|
||||
|
||||
echo "Original: “$#”" % Str1
|
||||
echo "Stripped: “$#”" % Str1.removeComments('#')
|
||||
echo "Original: “$#”" % Str2
|
||||
echo "Stripped: “$#”" % Str2.removeComments(';')
|
||||
Loading…
Add table
Add a link
Reference in a new issue