MySQL 8.4.0
Source Code Documentation
mysql_harness::anonymous_namespace{string_utils.cc} Namespace Reference

Functions

static std::optional< size_t > find_nth (const std::string_view &s, const char c, size_t n)
 Finds n-th occurence of character c in string s. More...
 

Function Documentation

◆ find_nth()

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 
)
static

Finds n-th occurence of character c in string s.

Parameters
sstring to search in
ccharacter to search for
nwhich occurence of c in s we are looking for
Returns
position of the nth occurence of character c in string c if found
nullopt if not found