RosettaCodeData/Task/Strip-comments-from-a-string/Oforth/strip-comments-from-a-string.oforth

5 lines
165 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
: stripComments(s, markers)
| firstMarker |
markers map(#[ s indexOf ]) reduce(#min) ->firstMarker
s firstMarker ifNotNull: [ left(firstMarker 1 - ) ] strip ;