title: Replacing multiple chars in a string with one character in Python
body: <p>I'm looking for a neat way to replace multiple occurrences of a particular character in a string with just one.</p>
  <p>For example:<br />
  I would like to convert such string:</p>
  <pre><code>string = '1;AA;;1234567;;some text;;some text;;;some text;some text;;;;;;1, 2, 3, 4, 5, 6;;;;;;;;;;;another text;;;;;;;;;;;;;'
  </code></pre>
  <p>to this:</p>
  <pre><code>string = '1;AA;1234567;some text;some text;some text;some text;1, 2, 3, 4, 5, 6;another text;'
  </code></pre>
  <p>One of the approaches is to use list-based replacement, but it requires making quite an enormous list since the number of duplicates varies in subsequent data lines.</p>
  <p>So something like this:</p>
  <pre><code>list = {';;':'';'.';;;'',';':'',';;;;':';',';;;;;':';'} #etc....
  input = input.replace(list) 
  </code></pre>
  <p>is not really a good idea.</p>
  <p>Any suggestions on how should I proceed?</p>
  <p>Regards,<br />
  J.</p>