| 60 | } |
| 61 | |
| 62 | TWtringBuf StripRight(const TWtringBuf text) noexcept { |
| 63 | if (!text) { |
| 64 | return {}; |
| 65 | } |
| 66 | |
| 67 | const auto* const pe = text.data() - 1; |
| 68 | const auto* p = text.data() + text.size() - 1; |
| 69 | |
| 70 | for (; p != pe && IsWhitespace(*p); --p) { |
| 71 | } |
| 72 | |
| 73 | return {pe + 1, p + 1}; |
| 74 | } |
| 75 | |
| 76 | void StripRight(TUtf16String& text) { |
| 77 | const auto stripped = StripRight(TWtringBuf(text)); |