title: How do I delete a single character in a string and use recursion in a string
body: <p>I'm not sure how I would delete a single character in my string because when  I use str.erase(x,y) from my understanding it would delete everything from "x" to "y". However, I just want to delete one character at "x".</p>
  
  <p>I also need to use recursion for this problem.</p>
  
  <p>I need to delete a random character from a string and output it and keep doing so until the string is empty.</p>
  
  <pre><code>string ObliterateString(string arg)
  {
  
    int length = arg.length();
    int random = 0;
  
    while(length &gt; 0)
    {
      if(length &lt;= 1)
      {
        return ObliterateString("");
      }
      else{
        random = rand() % length; //Get a random number that is between 0 and the length of the string
        arg.erase(random,random);
        cout &lt;&lt; arg &lt;&lt; endl;
      }
      length--;
    }
  
    return arg;
  }
  </code></pre>