* Skip some of the 'garbage' in the string that we don't want to use * to sort on. This way the alphabetical sorting will work better as * we would be actually using those characters instead of some other * characters such as spaces and tildes at the begin of the name. * @param str The string to skip the initial garbage of. * @return The string with the garbage skipped. */
| 408 | * @return The string with the garbage skipped. |
| 409 | */ |
| 410 | static std::string_view SkipGarbage(std::string_view str) |
| 411 | { |
| 412 | Utf8View view(str); |
| 413 | auto it = view.begin(); |
| 414 | const auto end = view.end(); |
| 415 | while (it != end && IsGarbageCharacter(*it)) ++it; |
| 416 | return str.substr(it.GetByteOffset()); |
| 417 | } |
| 418 | |
| 419 | /** |
| 420 | * Compares two strings using case insensitive natural sort. |
no test coverage detected