The standard library contains a string method called "substr" that can be used to create a substring of an existing string. It's included in string.h. Usage:
#include <string.h>
using namespace std;
// ...
string s1 = "...";
string s2 = s2.substr(3,5);
Where the two arguments are the starting position and length of the substring.
You can also create a substring by writing a loop to iterate through the individual characters and using them to create a new string.
Note that stringTrim() doesn't return a value other than through the parameter list.