#MATL, 22 21 bytes by Luis Mendo.
MATL, 22 21 bytes by Luis Mendo.
Finally... MickyT cracked it while I was writing an explanation, so his answer is the "valid" one. I posted this anyway, in accordance with this meta post.
M and Y are unnecessary and are commented out. It's enough to add 4 whitespace characters, not 5.
t' @ *'dm1e5%M dw%Y ( This is equivalent to the more compact:
t' @ *'dm7dw( Partial explanation:
% Implicit input t % Duplicate input ' @ *' % String with ASCII-values [32 64 32 42] d % diff, giving [32 -32 10], 32 is space, 10 is newline m % ismember, checking if the character is 32 or 10 1e5 % 10000, but could just as well be 7 d % Taking the diff of the scalar 1e5, returning an empty matrix [] w % Swap stack in order to use ( below ( % Equivalent to x(y)=[], where x is the input string, and y is the logical % vector found using ismember (m) % Implicit output