I'm able to get the first half of string:
insert1 = tCreatureOne.substr(0, (tCreatureOne.length) / 2
I don't know how to get the second half of the string
insert2 = tCreatureOne.substr((tCreatureOne.length) / 2), ?????)
Here is my code.
// Insert creature two in to the
//middle of creature one.Science!
// Hamster and Emu make a HamEmuster
std::string PerformScience(std::string tCreatureOne, std::string tCreatureTwo)
{
std::string insert1;
std::string insert2;
std::string insert3;
// first half : 0 to middle
insert1 = tCreatureOne.substr(0, (tCreatureOne.length) / 2);
// last half: from middle to the end
insert2 = tCreatureOne.substr((tCreatureOne.length) / 2), tCreatureOne.length);
insert3 = insert1 + tCreatureTwo + insert2;
return insert3;