I am splitting a string into smaller pieces based off of the delimiter "/"
.
stringstream ss(stringToSplit);
string item;
vector<std::string> splitStrings;
while (std::getline(ss, item, delimiter))
{
splitStrings.push_back(item);
}
some of the strings strings look like this:
home/user/folder
/home/user/folder
banana/grape/onion
/banana/grape/onion
The problem I am having is that the strings that have my delimiter "/"
in the front are creating an empty item at the start of the resulting vector. Is there a way to avoid this or to remove the empty item?
I have tried removing all " "
strings in the vector but they still remain.