| 4 | #include <util/string/reverse.h> |
| 5 | |
| 6 | void CollapseText(const TString& from, TString& to, size_t maxLen) { |
| 7 | Collapse(from, to, maxLen); |
| 8 | StripInPlace(to); |
| 9 | if (to.size() >= maxLen) { |
| 10 | to.remove(maxLen - 5); // " ..." |
| 11 | ReverseInPlace(to); |
| 12 | size_t pos = to.find_first_of(" .,;"); |
| 13 | if (pos != TString::npos && pos < 32) { |
| 14 | to.remove(0, pos + 1); |
| 15 | } |
| 16 | ReverseInPlace(to); |
| 17 | to.append(" ..."); |
| 18 | } |
| 19 | } |
nothing calls this directly
no test coverage detected