Trim trailing spaces from a string. More...
#include <strutils.h>
Public Member Functions | |
| std::string | operator() (const std::string &source, const char *delims=" \t\r\n") const |
| Trim a given string. | |
Trim trailing spaces from a string.
The trim class is a functor is used for trimming of trailing non-characters symbols (spaces, tabs and CRLFs) from a given string.
Example:
string s = dbp:trim()(" Test string\n"); // s is now initialized with "Test string"
| std::string dbp::trim::operator() | ( | const std::string & | source, | |
| const char * | delims = " \t\r\n" | |||
| ) | const |
Trim a given string.
| source | a string to trim | |
| delims | a delimeter chars (optional) |