4 kyu
Strip Comments
20,606 of 55,221jhoffner
Description:
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.
Example:
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:
var result = solution("apples, pears # and bananas\ngrapes\nbananas !apples", ["#", "!"])
// result should == "apples, pears\ngrapes\nbananas"
Strings
Algorithms
Similar Kata:
Stats:
Created | Jun 25, 2013 |
Published | Jun 25, 2013 |
Warriors Trained | 125513 |
Total Skips | 21572 |
Total Code Submissions | 530826 |
Total Times Completed | 55221 |
JavaScript Completions | 20606 |
CoffeeScript Completions | 145 |
Ruby Completions | 2404 |
Python Completions | 24762 |
Java Completions | 4050 |
Clojure Completions | 169 |
Kotlin Completions | 595 |
C# Completions | 3236 |
Crystal Completions | 26 |
Julia Completions | 48 |
VB Completions | 21 |
Factor Completions | 14 |
Scala Completions | 36 |
Total Stars | 2472 |
% of votes with a positive feedback rating | 83% of 5211 |
Total "Very Satisfied" Votes | 3803 |
Total "Somewhat Satisfied" Votes | 1076 |
Total "Not Satisfied" Votes | 332 |