string.replace generates function call error in c++
<p>trying to take a string and replace the lowercase letters to specific numbers (conversions apparent in code) using a while loop. string.replace gives an error "no matching member function for call to 'replace' :| been staring at the string.replace reference and can't see how my formatting is wrong.   </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;cctype&gt;
#include &lt;string&gt;

using namespace std;

int main() {

    // set variables

    string input_string;
    int string_length;
    bool isupper;
    bool isdig;
    int count;
    char current_var;
    string output_string;

    // Query user

    cout &lt;&lt; "Welcome to Josh's Password Generator. Enter a password and I will convert it into numbers for entry in a touchtone phone." &lt;&lt; endl;
    cin &gt;&gt; input_string;



    // calculations

    string_length = (int)input_string.length();
    count = 0;


    while(count &lt;= string_length)

        if (input_string.at(count) == 'a' || input_string.at(count) == 'b' || input_string.at(count) == 'c')
    {
        current_var = 1;
    }
        else if (input_string.at(count) == 'd' || input_string.at(count) == 'e' || input_string.at(count) == 'f')
    {
       current_var = 2;
    }
    else if (input_string.at(count) == 'g' || input_string.at(count) == 'h' || input_string.at(count) == 'i')
    {
        current_var = 3;
    }
    else if (input_string.at(count) == 'j' || input_string.at(count) == 'k' || input_string.at(count) == 'l')
    {
        current_var = 4;
        }
        else if (input_string.at(count) == 'm' || input_string.at(count) == 'n' || input_string.at(count) == 'o')
        {
            current_var = 5;
        }
        else if (input_string.at(count) == 'p' || input_string.at(count) == 'q' || input_string.at(count) == 'r')
        {
            current_var = 6;
        }
        else if (input_string.at(count) == 's' || input_string.at(count) == 't' || input_string.at(count) == 'u')
        {
            current_var = 7;
        }
        else if (input_string.at(count) == 'v' || input_string.at(count) == 'w' || input_string.at(count) == 'x')
        {
            current_var = 8;
        }
        else if (input_string.at(count) == 'y' || input_string.at(count) == 'z')
        {
            current_var = 9;
        }
        else
            current_var = input_string.at(count);

        input_string = input_string.replace(count, current_var);

        count = count + 1;


    }
</code></pre>