I have a string that looks like this
\\x\\y\\z-Select * from x where y=z
I need to split this at the '-' into two strings. When I use substr as,
string s = "\\x\\y\\z-Select * from x where y=z"; size_t p = s.find("-"); if(p!=string::npos) string query = s.substr(p+1);
but how do i get the part before the position?