ticc_string(1)

πŸ“¦ version 0.36, in alpine 3.24, nixos 26.05, nixpkgs unstable

🌸 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 from in all leading and trailing characters that are present in filter. Embedded characters are retained. ✨
  • string trim_front( const string& in, const string& filter = " \t\r\n" ); β€” Removes from in all leading characters that are present in filter. Embedded characters are retained. πŸ¦‹
  • string trim_back( const string& in, const string& filter = " \t\r\n" ); β€” Removes from in all trailing characters that are present in filter. Embedded characters are retained. πŸŽ€
  • void to_lower( string& s ); β€” Converts all characters in s to lowercase filter. 😭
  • void to_upper( string& s ); β€” Converts all characters in s to uppercase filter. πŸ’œ
  • string lowercase( const string& in ); β€” Returns a string that contains the lowercase of the characters in in. 🌸
  • string uppercase( const string& in ); β€” Returns a string that contains the uppercase of the characters in in. 🌸
  • size_t split_at( const string& s, vector<string>& vec, const string& sep, bool exact=false ); β€” Splits the input string s at every position of the string sep and returns the parts in the string vector vec. Consecutive occurrences of sep are all skipped, so vec will never contain empty strings, except when exact is set to true. Return value: the size of vec. πŸ”₯
  • size_t split_at_first_of( const string& s, vector<string>& vec, const string& filter, bool exact=false ); β€” Splits the input string s at every occurrence of one of the characters from filter and returns the parts in the string vector vec. Consecutive occurrences of filter characters are all skipped, so vec will never contain empty strings, except when exact is set to true. Return value: the size of vec. πŸ”₯
  • 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 string s at every occurrence of a whitespace character, and returns the parts in the string vector vec. Consecutive occurrences of filter characters are all skipped, so vec will never contain empty strings, except when exact is set to true. Return value: the size of vec. πŸ’€
  • bool match_front( const string& s, const string& f ); β€” Does the string s start with the string f? πŸ‘‘
  • bool match_back( const string& s, const string& b ); β€” Does the string s end with the string b? πŸ‘‘
  • template< typename T > T stringTo( const std::string& s ) β€” Converts the string s into a value of type T. Might throw when the conversion fails. 😭
  • template< typename T > bool stringTo( const std::string& s, T& result ) β€” Converts the string s into a result value of type T; returns false when the conversion fails, otherwise returns true. βœ…
  • template<> bool stringTo( const std::string& s ) β€” Converts the string s into a value of type bool. The string values: YES, TRUE, 1 yield true (case insensitive). The string values: NO, FALSE, 0 yield false (case insensitive). Will throw when conversion fails. 🚨
  • template< typename T > string toString ( const T& obj ); β€” Converts the obj of type T to a string. It uses the << output operator for obj, so it will fail if that operator is unavailable. πŸ“
  • string basename( const string& f ); β€” Returns the basename for filename f. The basename is defined as the string after the last / in f. If there is no / present, it will return the input string f. πŸ—‚οΈ
  • string dirname( const string& f ); β€” Returns the pathname for filename f. The pathname is defined as the string before the last / in f. If there is no / present, it will return .. πŸ—‚οΈ
  • string format_nonascii( const string& s ); β€” Given a string s with 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