Strip comments from a string: Difference between revisions
Added Arturo implementation
m (→{{header|Phix}}: syntax coloured) |
Drkameleon (talk | contribs) (Added Arturo implementation) |
||
Line 266:
260 LET S$ = MID$(S$, 1, I)
270 RETURN</lang>
=={{header|Arturo}}==
<lang rebol>stripComments: function [str][
strip replace str {/[#;].+/} ""
]
loop ["apples, pears # and bananas", "apples, pears ; and bananas"] 'str [
print [str "->" stripComments str]
]</lang>
{{out}}
<pre>apples, pears # and bananas -> apples, pears
apples, pears ; and bananas -> apples, pears</pre>
=={{header|AutoHotkey}}==
|