RosettaCodeData/Task/Strip-comments-from-a-string/Inform-7/strip-comments-from-a-strin...

12 lines
295 B
INI

Home is a room.
When play begins:
strip comments from "apples, pears # and bananas";
strip comments from "apples, pears ; and bananas";
end the story.
To strip comments from (T - indexed text):
say "[T] -> ";
replace the regular expression "<#;>.*$" in T with "";
say "[T][line break]".