| 325 | } |
| 326 | |
| 327 | [[nodiscard]] constexpr text_view trim_start(const text_view& text_set = text_view(u8" \t")) const noexcept |
| 328 | { |
| 329 | if(this->is_empty()) |
| 330 | return { }; |
| 331 | if(text_set.is_empty()) |
| 332 | return *this; |
| 333 | auto iterator = this->begin(); |
| 334 | const u64 size = this->size(); |
| 335 | for(u64 i = 0; i < size; ++i) |
| 336 | { |
| 337 | if(const auto cp = *iterator; !text_set.contains(cp)) |
| 338 | return this->subview(i); |
| 339 | ++iterator; |
| 340 | } |
| 341 | return { }; |
| 342 | } |
| 343 | |
| 344 | [[nodiscard]] constexpr text_view trim_end(const text_view& text_set = text_view(u8" \t")) const noexcept |
| 345 | { |