title: Replace Space to Hyphen
body: <p>I am trying to replace a space character into a hyphen I have in my string.</p>
  
  <pre><code>String replaceText = "AT AT";
  replaceText.replace(' ', '-');
  </code></pre>
  
  <p>but when I do this, I cannot seem to replace the character. I tried the <code>replaceAll()</code> method and it doesn't work either.</p>
  
  <p><strong>++++++Answer+++++++</strong></p>
  
  <p>sorry my mistake.. the result of late night programming :(</p>
  
  <p>thanks for the answer i cant probably answer all so i will check the first answer</p>
  
  <pre><code>replaceText = replaceText.replace(' ', '-');
  </code></pre>