Returns the prefix of 'str' before the first comma in it; returns the entire string if it contains no comma.
| 7073 | // Returns the prefix of 'str' before the first comma in it; returns |
| 7074 | // the entire string if it contains no comma. |
| 7075 | inline std::string GetPrefixUntilComma(const char* str) { |
| 7076 | const char* comma = strchr(str, ','); |
| 7077 | return comma == nullptr ? str : std::string(str, comma); |
| 7078 | } |
| 7079 | |
| 7080 | // Splits a given string on a given delimiter, populating a given |
| 7081 | // vector with the fields. |
no outgoing calls
no test coverage detected