| 149 | // ======= SUBSTRING ======= |
| 150 | |
| 151 | string string::substring(fl::size start, fl::size end) const FL_NOEXCEPT { |
| 152 | if (start == 0 && end == size()) return *this; |
| 153 | if (start >= size()) return string(); |
| 154 | if (end > size()) end = size(); |
| 155 | if (start >= end) return string(); |
| 156 | string out; |
| 157 | out.copy(c_str() + start, end - start); |
| 158 | return out; |
| 159 | } |
| 160 | |
| 161 | string string::substr(fl::size start, fl::size length) const FL_NOEXCEPT { |
| 162 | // Handle `npos` / overflow: when `length == npos` the caller |
no test coverage detected