MySQL 8.4.2
Source Code Documentation
string_utils.cc File Reference
#include "mysql/harness/string_utils.h"
#include <algorithm>
#include <optional>
#include <sstream>
#include <string>
#include <string_view>
#include <vector>

Namespaces

namespace  mysql_harness
 
namespace  mysql_harness::anonymous_namespace{string_utils.cc}
 

Functions

HARNESS_EXPORT std::vector< std::string > mysql_harness::split_string (const std::string_view &data, const char delimiter, bool allow_empty=true)
 Splits a string using a delimiter. More...
 
HARNESS_EXPORT void mysql_harness::left_trim (std::string &str)
 Removes leading whitespaces from the string. More...
 
HARNESS_EXPORT void mysql_harness::right_trim (std::string &str)
 Removes trailing whitespaces from the string. More...
 
HARNESS_EXPORT void mysql_harness::trim (std::string &str)
 Removes both leading and trailing whitespaces from the string. More...
 
static std::optional< size_t > mysql_harness::anonymous_namespace{string_utils.cc}::find_nth (const std::string_view &s, const char c, size_t n)
 Finds n-th occurence of character c in string s. More...
 
HARNESS_EXPORT std::string mysql_harness::limit_lines (const std::string &str, const size_t limit, const std::string &replace_with="")
 Returns the input string with number of lines reduced to selected value. More...