MCPcopy Create free account
hub / github.com/bytedance/dplm / split

Function split

analysis/TMalign.cpp:333–351  ·  view source on GitHub ↗

split a long string into vectors by whitespace * line - input string * line_vec - output vector * delimiter - delimiter */

Source from the content-addressed store, hash-verified

331 * line_vec - output vector
332 * delimiter - delimiter */
333void split(const string &line, vector<string> &line_vec,
334 const char delimiter=' ')
335{
336 bool within_word = false;
337 for (int pos=0;pos<line.size();pos++)
338 {
339 if (line[pos]==delimiter)
340 {
341 within_word = false;
342 continue;
343 }
344 if (!within_word)
345 {
346 within_word = true;
347 line_vec.push_back("");
348 }
349 line_vec.back()+=line[pos];
350 }
351}
352
353/* strip white space at the begining or end of string */
354string Trim(const string &inputString)

Callers 2

get_PDB_linesFunction · 0.70
output_superposeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected