Utility function to split the string using a delim . Refer - http : stackoverflow . com / questions / 236129 / split - a - string - in - c
vector < string > split ( const string & s , char delim ) { vector < string > elems ; stringstream ss ( s ) ; string item ; while ( getline ( ss , item , delim ) ) elems . push_back ( item ) ; return elems ; }