#pragma once #include #include #include std::string remove_substring(const std::string_view string, const std::string_view substring); std::string replace_substring(const std::string_view string, const std::string_view substring, const std::string_view replacement); bool string_contains(const std::string_view a, const std::string_view b); bool string_starts_with(const std::string_view haystack, const std::string_view needle); bool is_numeric(const std::string_view string); std::vector tokenize(const std::string_view string, const std::string_view& delimiters = ","); namespace utility { template inline void format_internal_format(std::string& msg, const Arg& arg) { auto pos = msg.find_first_of("{}"); msg.replace(pos, 2, arg); } template std::string format(const std::string_view format, Args&&... args) { auto msg = std::string(format); ((format_internal_format(msg, args)), ...); return msg; } }