title: Remove character from string in Kotlin
body: <p>I am trying to create an Android calculator which uses strings in Kotlin. I do not know how to delete a comma (or the negative) if it already contains one.</p>
  <p>Here is my code which adds the comma correctly but doesn't delete it if the user clicks again:</p>
  <pre class="lang-kotlin prettyprint-override"><code>if (!buClickValue.contains(&quot;.&quot;)) {
      buClickValue += &quot;.&quot;
  } else {
      buClickValue.replace(&quot;.&quot;, &quot;&quot;)
  }
  </code></pre>