#include <iostream>
#include <string>
#include <algorithm>
#include <ctype.h> // for http://w...content-available-to-author-only...s.com/reference/cctype/isdigit/

int main()
{
    std::string str = "HelloTheir453Their54Hello" ;

    // loop
    for( char& c : str ) if( ::isdigit(c) ) c = '*' ;
    std::cout << str << '\n' ;

    str = "cvvc2hvc7r6464677VJVJvju78uR&R56fuvfcJv" ;

    // algorithm http://w...content-available-to-author-only...s.com/reference/algorithm/replace_if/
    std::replace_if( str.begin(), str.end(), ::isdigit, '*' ) ;
    std::cout << str << '\n' ;
}
