tottakai / StringUtils

StringUtils

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StringUtils

Ruby like C++ string utilities. Just include stringutils.h to your project to use.

Examples

tottakai::split_map calls the given function for all the produced substrings.

tottakai::split_map("Little brown fox", ' ', [] (const std::string& substr) {
	std::cout << substr << std::endl;
});

tottakai::strip removes leading and trailing whitespace

tottakai::strip(" foo ") outputs "foo"

tottakai::lstrip removes leading whitespace

tottakai rstrip removes trailing whitespace

tottakai::partition searcher for separator in the string and returns the part before it, the separator, and the part after it.

tottakai::rpartition searcher for separator in the string from the end of string and returns the part before it, the separator, and the part after it.

tottakai::each_line calls func for every line in str.

About

StringUtils


Languages

Language:C++ 76.6%Language:C 12.3%Language:Python 10.9%Language:Shell 0.2%