RosettaCodeData/Task/Strip-comments-from-a-string/Arturo/strip-comments-from-a-string.arturo
2023-07-01 13:44:08 -04:00

7 lines
186 B
Text

stripComments: function [str][
strip replace str {/[#;].+/} ""
]
loop ["apples, pears # and bananas", "apples, pears ; and bananas"] 'str [
print [str "->" stripComments str]
]