ticc_string(1)
πΈ NAME πΈ
Okay bestie, welcome to ticc_string(1) from the General Commands Manual β it's giving βC++ string utilities that ate.β π
ticc_string is literally a collection of C++ string manipulating utilities. Periodt. π«Ά
β¨ SYNOPSIS β¨
#include ticcutils/StringOps.h
using namespace TiCC;
π DESCRIPTION π
Ticc String Utilities serves up a few convenient functions for manipulating C++ string objects. These functions are widely used in the TiCC software stack , but they are of general use too. No gatekeeping, bestie. π
π List of Functions π
string trim( const string& in, const string& filter= " \t\r\n" );β Removes frominall leading and trailing characters that are present infilter. Embedded characters are retained. β¨string trim_front( const string& in, const string& filter = " \t\r\n" );β Removes frominall leading characters that are present infilter. Embedded characters are retained. π¦string trim_back( const string& in, const string& filter = " \t\r\n" );β Removes frominall trailing characters that are present infilter. Embedded characters are retained. πvoid to_lower( string& s );β Converts all characters insto lowercase filter. πvoid to_upper( string& s );β Converts all characters insto uppercase filter. πstring lowercase( const string& in );β Returns a string that contains the lowercase of the characters inin. πΈstring uppercase( const string& in );β Returns a string that contains the uppercase of the characters inin. πΈsize_t split_at( const string& s, vector<string>& vec, const string& sep, bool exact=false );β Splits the input stringsat every position of the stringsepand returns the parts in the string vectorvec. Consecutive occurrences ofsepare all skipped, sovecwill never contain empty strings, except whenexactis set totrue. Return value: the size ofvec. π₯size_t split_at_first_of( const string& s, vector<string>& vec, const string& filter, bool exact=false );β Splits the input stringsat every occurrence of one of the characters fromfilterand returns the parts in the string vectorvec. Consecutive occurrences of filter characters are all skipped, sovecwill never contain empty strings, except whenexactis set totrue. Return value: the size ofvec. π₯inline size_t split( const string& s, vector<string>& vec, bool exact=false return split_at_first_of( s, vec, " \t\r\n" ); }β Splits the input stringsat every occurrence of a whitespace character, and returns the parts in the string vectorvec. Consecutive occurrences of filter characters are all skipped, sovecwill never contain empty strings, except whenexactis set totrue. Return value: the size ofvec. πbool match_front( const string& s, const string& f );β Does the stringsstart with the stringf? πbool match_back( const string& s, const string& b );β Does the stringsend with the stringb? πtemplate< typename T > T stringTo( const std::string& s )β Converts the stringsinto a value of typeT. Might throw when the conversion fails. πtemplate< typename T > bool stringTo( const std::string& s, T& result )β Converts the stringsinto aresultvalue of typeT; returnsfalsewhen the conversion fails, otherwise returnstrue. βtemplate<> bool stringTo( const std::string& s )β Converts the stringsinto a value of typebool. The string values:YES,TRUE,1yieldtrue(case insensitive). The string values:NO,FALSE,0yieldfalse(case insensitive). Will throw when conversion fails. π¨template< typename T > string toString ( const T& obj );β Converts theobjof typeTto a string. It uses the<<output operator forobj, so it will fail if that operator is unavailable. πstring basename( const string& f );β Returns the basename for filenamef. The basename is defined as the string after the last/inf. If there is no/present, it will return the input stringf. ποΈstring dirname( const string& f );β Returns the pathname for filenamef. The pathname is defined as the string before the last/inf. If there is no/present, it will return .. ποΈstring format_nonascii( const string& s );β Given a stringswith possibly unprintable (non-ascii) characters, produces a string where these are replaced by hexadecimal representations. Useful for debugging Unicode stuff. π§
π AUTHORS π
Ko van der Sloot β lamasoftware@science.ru.nl π
xoxo π β this page is from the General Commands Manual, dated 2015 November 26, and it's ticc_string(1) in all its iconic glory. π
π¦ where this page comes from
- alpine 3.24: ticcutils-doc 0.36-r2 Β· GPL-3.0-only
- nixos 26.05: ticcutils 0.37
- nixpkgs unstable: ticcutils 0.38
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms