How to insert repeated character in a string with C++

1 Answer

0 votes
#include <iostream>
 
using namespace std;

int main() {
    string s = "PythonJavaPHPC++";
 
    s.insert(4, 5, 'Z');
    cout << s;
}
 
 
 
/*
 
PythZZZZZonJavaPHPC++
 
*/

 



answered Jan 15, 2020 by avibootz

Related questions

1 answer 104 views
1 answer 117 views
1 answer 133 views
1 answer 145 views
1 answer 152 views
2 answers 247 views
1 answer 186 views
...