MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / split

Function split

Hackerrank_problems/diagonal-difference/solution.cpp:95–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95vector<string> split(const string &str) {
96 vector<string> tokens;
97
98 string::size_type start = 0;
99 string::size_type end = 0;
100
101 while ((end = str.find(" ", start)) != string::npos) {
102 tokens.push_back(str.substr(start, end - start));
103
104 start = end + 1;
105 }
106
107 tokens.push_back(str.substr(start));
108
109 return tokens;
110}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected