split array of charachter into two part

is there a function that will split array of charachter in to two parts.

for example.

if we have a string "mashineGun" and we search for the string "mashine" that will
return the rest of the string in this case "Gun".


personaly i dont know (or i have a short memory) any functions that splits a char array

Maybe substr(int startindex,int count) could help you, but that works only for strings, however you are able to convert char array to string and vice versa

edit

like this:
1
2
3
string myString = "machineGun";
string SubStr1 = myString.substr(0,7); //SubStr1 = "machine"
string SubStr2 = myString.substr(7,3); //Substr2 = "Gun" 
Last edited on
O.k thank you guys, i thaught that this function is maybe present in some library.
but I will do the programming :)
Topic archived. No new replies allowed.