title: Replace blank spaces and semicolon in Java with Regex
body: <p>I am trying to replace all strings that can contain any number of blank spaces followed by an ending ";", with just a ";"  but I am confused because of the multiple blank spaces.</p>
  
  <pre><code>"ExampleString1            ;" -&gt; "ExampleString1;"
  "ExampleString2  ;" -&gt; "ExampleString2;"
  "ExampleString3     ;" -&gt; "ExampleString3;"
  "ExampleString1 ; ExampleString1 ;" -----&gt; ExampleString1;ExampleString1
  </code></pre>
  
  <p>I have tried like this: <code>example.replaceAll("\\s+",";")</code> but the problem is that there can be multiple blank spaces and that confuses me</p>