I find it difficult to determine how to replace every white space '', except for the thousands that appear between " ".
For instance -
a = c + d;
is an
a=c+d
and
foo ("hi bye", "bye hi");
is an
foo("hi bye","bye hi");
I tried something like
re.sub('^(\"[^\"\n]*\")|\s|\\n', '', line)
but obviously this does not work.
source
share