Pagini recente » Cod sursa (job #1032778) | Cod sursa (job #575830) | Cod sursa (job #1975487) | Cod sursa (job #2961209) | Cod sursa (job #1174973)
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class test
{
public:
int func(vector<string> v1, vector<string>v2)
{
vector<string>::iterator it;
string::iterator it2;
string bum="bum";
string st;
for(it=v1.begin(); it!=v1.end(); it++)
st+=*it; // concatenare
// insert
cout<<st<<"\n";
st.insert(4," ");
st.insert(4,v2[0]);
it2=st.begin();
st.insert(it2,bum.begin(),bum.begin()+3);
// erase
st.erase(st.begin(), st.begin()+3);
//substr
st=st.substr(1,3);
// copy
st.copy(bum,1,1);
cout<<st<<"\n";
}
}tst;
int main()
{
vector<string> v1,v2;
v1.push_back("oioio");
v1.push_back("aiaia");
v2.push_back(" XOY ");
tst.func(v1,v2);
}