$darkmode
string.hpp File Reference
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for string.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool fable::starts_with (std::string_view s, std::string_view prefix)
 
bool fable::ends_with (std::string_view s, std::string_view suffix)
 
std::string fable::join_vector (const std::vector< std::string > &v, std::string_view sep)
 
std::vector< std::string > fable::split_string (std::string_view s, std::string_view sep)
 

Detailed Description

Function Documentation

◆ split_string()

std::vector< std::string > fable::split_string ( std::string_view  s,
std::string_view  sep 
)

Split string into vector by a separator.

  • The separator is stripped from the output.
  • Multiple separators result in empty strings.
  • An empty separator results in a vector of individual characters.
Parameters
sinput string view
sepseparator to split by