MCPcopy Create free account
hub / github.com/BirolLab/abyss / chomp

Function chomp

Common/StringUtil.h:21–29  ·  view source on GitHub ↗

If the last character of s is c, remove it and return true. */

Source from the content-addressed store, hash-verified

19
20/** If the last character of s is c, remove it and return true. */
21static inline bool chomp(std::string& s, char c = '\n')
22{
23 unsigned back = s.length() - 1;
24 if (!s.empty() && s[back] == c) {
25 s.erase(back);
26 return true;
27 } else
28 return false;
29}
30
31/** Return the SI representation of n. */
32static inline std::string toSI(double n)

Callers 4

TESTFunction · 0.85
mergeContigsFunction · 0.85
mergeContigsFunction · 0.85
FastaReaderClass · 0.85

Calls 3

eraseMethod · 0.80
lengthMethod · 0.45
emptyMethod · 0.45

Tested by 1

TESTFunction · 0.68