Strip comments from a string: Difference between revisions
Content added Content deleted
(Added PicoLisp) |
|||
Line 111: | Line 111: | ||
print ( string.match( s1, "[^"..comment_symbols.."]+" ) ) |
print ( string.match( s1, "[^"..comment_symbols.."]+" ) ) |
||
print ( string.match( s2, "[^"..comment_symbols.."]+" ) )</lang> |
print ( string.match( s2, "[^"..comment_symbols.."]+" ) )</lang> |
||
=={{header|PicoLisp}}== |
|||
<lang PicoLisp>(for Str '("apples, pears # and bananas" "apples, pears ; and bananas") |
|||
(prinl (car (split (chop Str) "#" ";"))) )</lang> |
|||
Output: |
|||
<pre>apples, pears |
|||
apples, pears </pre> |
|||
=={{header|PureBasic}}== |
=={{header|PureBasic}}== |