User Guide
nmodl::stringutils Namespace Reference

string utility functions More...

Detailed Description

string utility functions

Enumerations

enum  text_alignment { text_alignment::left, text_alignment::right, text_alignment::center }
 text alignment when printing in the tabular form More...
 

Functions

std::string to_string (double value, const std::string &format_spec="{:.16g}")
 Convert double value to string without trailing zeros. More...
 
static std::string ltrim (std::string text)
 
static std::string rtrim (std::string text)
 
static std::string trim (std::string text)
 
static std::string remove_character (std::string text, const char c)
 Remove all occurrences of a given character in a text. More...
 
static std::string trim_newline (std::string text)
 
static std::string escape_quotes (const std::string &text)
 Escape double-quote in a text, useful for JSON pretty printer. More...
 
static std::vector< std::string > split_string (const std::string &text, char delimiter)
 Split a text in a list of words, using a given delimiter character. More...
 
static std::string align_text (const std::string &text, int width, text_alignment type)
 Aligns a text within a field of width width. More...
 
static std::string tolower (std::string text)
 To lower case. More...