Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 518 Bytes

File metadata and controls

26 lines (22 loc) · 518 Bytes

Instructions

Complete the solution so that it strips all text that follows any of a set of comment markers passed in. Any whitespace at the end of the line should also be stripped out.

Examples

Given an input string of:

apples, pears # and bananas
grapes
bananas !apples

The output expected would be:

apples, pears
grapes
bananas

The code would be called like so:

solution("apples, pears # and bananas\ngrapes\nbananas !apples", ["#", "!"])
    => "apples, pears\ngrapes\nbananas"