diff --git a/AK/StringUtils.cpp b/AK/StringUtils.cpp index 31b2216d473..cc73f203ae9 100644 --- a/AK/StringUtils.cpp +++ b/AK/StringUtils.cpp @@ -9,12 +9,15 @@ #include #include #include -#include #include #include #include #include +#ifndef KERNEL +# include +#endif + namespace AK { namespace StringUtils { @@ -415,6 +418,7 @@ Optional find_any_of(StringView haystack, StringView needles, SearchDire return {}; } +#ifndef KERNEL String to_snakecase(StringView str) { auto should_insert_underscore = [&](auto i, auto current_char) { @@ -484,6 +488,7 @@ String replace(StringView str, StringView needle, StringView replacement, bool a replaced_string.append(str.substring_view(last_position, str.length() - last_position)); return replaced_string.build(); } +#endif // TODO: Benchmark against KMP (AK/MemMem.h) and switch over if it's faster for short strings too size_t count(StringView str, StringView needle)