Split it. But not all!
R, 34 bytes
Regular unmodified scan
with the appropriate arguments for text
, sep
and quote
should do it.
function(D,I,S)scan(,t=S,"",,,D,I)
Try it online!
C (gcc), 64 bytes
c;f(d,i,s)char*s;{for(;*s;s++)*s==i?c=!c:putchar(d-*s|c?*s:10);}
Try it online!
JavaScript (Node.js), 57 bytes
(d,i,s)=>s.replace(c=/./g,e=>i==e?(c^=1,''):d!=e|c?e:`
`)
Try it online!
Pip, 18 bytes
FxcxQb?!:oOo?xRanx
Takes inputs as command-line arguments. Try it online!
Completely different approach: process the string one character at a time and output the desired results newline-delimited.
How?
a,b,c are cmdline args (respectively representing D,I,S); o is 1;
n is newline (implicit)
We use o for a flag indicating whether or not to change D into newline
Fxc For each character x in c:
xQb? If x equals b (the ignore character),
!:o Logically negate o in-place
O Else, output the following (with no trailing newline):
o? If o is truthy,
xRan x, with a (the delimiter) replaced with newline
x Else, x unchanged