* @brief Find the byte offset of the nth UTF-8 character. * @param n The character index (0-based). * @return The byte offset, or npos if n >= character count. */
| 4189 | * @return The byte offset, or npos if n >= character count. |
| 4190 | */ |
| 4191 | size_type utf8_find_nth(size_type n) const noexcept { |
| 4192 | sz_ptr_t start; |
| 4193 | sz_size_t length; |
| 4194 | sz_string_range(&string_, &start, &length); |
| 4195 | auto ptr = sz_utf8_find_nth(start, length, n); |
| 4196 | return ptr ? ptr - start : npos; |
| 4197 | } |
| 4198 | |
| 4199 | /** |
| 4200 | * @brief Iterate over UTF-8 characters (codepoints) in the string. |
no test coverage detected