Created
December 24, 2016 02:19
-
-
Save railsstudent/3658220f7fc9d234ead242ad54a42b8c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function solution(input, markers){ | |
var comments = input.split('\n'); | |
for (var i in markers) { | |
for (var j in comments) { | |
var line = null; | |
var idx = comments[j].indexOf(markers[i]); | |
if (idx >= 0) { | |
comments[j] = comments[j].substring(0, idx).trim(); | |
} | |
} | |
} | |
return comments.join('\n'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment