For example, computing this with inputs
e for the character yields:
codegolf.stackexchange.com cdegolf.stackexchange.com cegolf.stackexchange.com ceolf.stackexchange.com celf.stackexchange.com cef.stackexchange.com ce.stackexchange.com cestackexchange.com cetackexchange.com ceackexchange.com ceckexchange.com cekexchange.com ceexchange.com ceechange.com ceehange.com ceeange.com ceenge.com ceege.com ceee.com ceeecom ceeeom ceeem ceee
It keeps the first character and all
es. All other characters are removed one by one.
Your task is to write a program (or function) that takes two inputs and outputs (or returns) a string that accomplishes this effect.
- You can assume that the string will not contain any newlines.
- The second input will always be one character.
- If the answer is in the form of a function, you may return an array of strings containing each line in the output.
- The output can contain a trailing newline.
Test Cases Tst Cases Ts Cases TsCases Tsases Tsses Tsss
Make a "Ceeeeeeee" program,
Make a "Ceeeeeeee" program Mke a "Ceeeeeeee" program Me a "Ceeeeeeee" program Mea "Ceeeeeeee" program Me "Ceeeeeeee" program Me"Ceeeeeeee" program MeCeeeeeeee" program Meeeeeeeee" program Meeeeeeeee program Meeeeeeeeeprogram Meeeeeeeeerogram Meeeeeeeeeogram Meeeeeeeeegram Meeeeeeeeeram Meeeeeeeeeam Meeeeeeeeem Meeeeeeeee
Hello World! Hllo World! Hlo World! Ho World! H World! HWorld! Horld! Hrld! Hld! Hd! H!
Hello World! Hllo World! Hlo World! Ho World! H World! HWorld! Horld! Hrld! Hld! Hd! H! H
alphabet aphabet ahabet aabet aaet aat aa
upperCASE uperCASE uerCASE ueCASE ueASE ueSE ueE ue
This is code-golf, so the shortest code (in bytes) wins.