Velpus Captiosus
Well-Known Coder
I have this code:
In my brain this splits a string.For example if we have the query string "Hello|World|" and the delimeter char 'I' we should get in the output : Hello World.Yet when I am running the program it doesnt!
C++:
#include <string.h>
void splitString(string query,char delimeter)
{
int i,j=0;
int end = query.size();
while(i<end)
{
j = query.find(delimeter,i);
cout << query.substr(i,j);
i = j;
}
}
In my brain this splits a string.For example if we have the query string "Hello|World|" and the delimeter char 'I' we should get in the output : Hello World.Yet when I am running the program it doesnt!