replacing spaces in java using replace or replaceAll
<p>I'm working on a java project and I need to send a date format within a URL but the container of date send it with spaces which is impossible so i convert it to a string and I used the replace method to replace the spaces with "" or "-" but it didn't work </p>

<p>Here is the code:</p>

<pre><code>Date date = date_debut.getDate();
String dateconver= date.toString();
String datef= dateconver.replace(" ", "");
</code></pre>

<p>And here is the error: incompatible types string can not be converted to char </p>

<p>I have tried also to use replaceAll but the IDE didn't even show it </p>