Version: SMASH-3.1
stringfunctions.cc File Reference
#include "smash/stringfunctions.h"
#include <numeric>
#include <sstream>

Go to the source code of this file.

Namespaces

 smash
 
 smash::utf8
 

Functions

static size_t smash::utf8::adjust (const std::string &s, size_t width)
 Adjust filling width by taking the size of unicode characters into account. More...
 
std::string smash::utf8::fill_left (const std::string &s, size_t width, char fill=' ')
 Fill string with characters to the left until the given width is reached. More...
 
std::string smash::utf8::fill_right (const std::string &s, size_t width, char fill=' ')
 Fill string with characters to the right until the given width is reached. More...
 
std::string smash::utf8::fill_both (const std::string &s, size_t width, char fill=' ')
 Fill string with characters at both sides until the given width is reached. More...
 
std::string smash::trim (const std::string &s)
 Strip leading and trailing whitespaces. More...
 
void smash::remove_substr (std::string &s, const std::string &p)
 Remove all instances of a substring p in a string s. More...
 
void smash::isoclean (std::string &s)
 Remove ⁺, ⁻, ⁰ from string. More...
 
template<typename Out >
void smash::split (const std::string &s, char delim, Out result)
 Split string by delimiter. More...
 
std::vector< std::string > smash::split (const std::string &s, char delim)
 Split string by delimiter. More...
 
std::string smash::join (const std::vector< std::string > &v, const std::string &delim)
 Join strings using delimiter. More...
 
std::string smash::quote (const std::string &s)
 Add quotes around string. More...