WarpX
Namespaces | Functions
StringUtils.H File Reference
#include <AMReX_Utility.H>
#include <string>
#include <vector>

Go to the source code of this file.

Namespaces

 utils::strings
 

Functions

template<typename Container >
auto utils::strings::split (std::string const &instr, std::string const &separator, bool const trim=false, std::string const &trim_space=" \)
 Splits a string using a string separator. This is somewhat similar to amrex::Tokenize. The main difference is that, if the separator ":" is used, amrex::Tokenize will split ":3::2" into ["3","2"] while this functio will split ":3::2" into ["","3","","2"]. This function can also perform a trimming to remove whitespaces (or any other arbitrary string) from the split string. More...
 
std::vector< std::string > utils::strings::automatic_text_wrap (const std::string &text, const int max_line_length)
 This function performs automatic text wrapping on a string, returning an array of strings each not exceeding the maximum line length (unless the text contains a word exceeding the maximum line length). More...