xtd - Reference Guide  0.1.0
Modern c++17 framework to create console, gui and unit test applications on Windows, macOS and Linux.
xtd::strings Class Reference

The strings Caintains string operation methods. More...

#include <strings.h>

Static Public Member Functions

template<typename object_t >
static std::string class_name ()
 Gets the class name of the object_t. More...
 
template<typename object_t >
static std::string class_name (const object_t &object)
 Gets the class name of the specified object. More...
 
static std::string class_name (const std::type_info &info)
 
template<typename char_t >
static int compare (const std::basic_string< char_t > &str_a, const std::basic_string< char_t > &str_b) noexcept
 Compares two specified String objects and returns an integer that indicates their relative position in the sort order. More...
 
template<typename char_t >
static int compare (const std::basic_string< char_t > &str_a, const std::basic_string< char_t > &str_b, bool ignore_case) noexcept
 Compares two specified String objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order. More...
 
template<typename char_t >
static int compare (const std::basic_string< char_t > &str_a, const std::basic_string< char_t > &str_b, xtd::string_comparison comparison_type) noexcept
 Compares two specified String objects using the specified rules, and returns an integer that indicates their relative position in the sort order. More...
 
template<typename char_t >
static int compare (const std::basic_string< char_t > &str_a, size_t index_a, const std::basic_string< char_t > &str_b, size_t index_b, size_t length) noexcept
 Compares substrings of two specified String objects and returns an integer that indicates their relative position in the sort order. More...
 
template<typename char_t >
static int compare (const std::basic_string< char_t > &str_a, size_t index_a, const std::basic_string< char_t > &str_b, size_t index_b, size_t length, bool ignore_case) noexcept
 Compares substrings of two specified String objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order. More...
 
template<typename char_t >
static int compare (const std::basic_string< char_t > &str_a, size_t index_a, const std::basic_string< char_t > &str_b, size_t index_b, size_t length, xtd::string_comparison comparison_type) noexcept
 Compares substrings of two specified String objects using the specified rules, and returns an integer that indicates their relative position in the sort order. More...
 
template<typename char_t >
static std::basic_string< char_t > concat (const std::basic_string< char_t > &str_a, const std::basic_string< char_t > &str_b, const std::basic_string< char_t > &str_c, const std::basic_string< char_t > &str_d) noexcept
 Concatenates four specified instances of string. More...
 
template<typename char_t , typename ObjectA , typename ObjectB , typename ObjectC , typename ObjectD >
static std::basic_string< char_t > concat (ObjectA obj_a, ObjectB obj_b, ObjectC obj_c, ObjectD obj_d) noexcept
 Concatenates four specified instances of object. More...
 
template<typename ObjectA , typename ObjectB , typename ObjectC , typename ObjectD >
static std::string concat (ObjectA obj_a, ObjectB obj_b, ObjectC obj_c, ObjectD obj_d) noexcept
 Concatenates four specified instances of object. More...
 
template<typename char_t >
static std::basic_string< char_t > concat (const std::basic_string< char_t > &str_a, const std::basic_string< char_t > &str_b, const std::basic_string< char_t > &str_c) noexcept
 Concatenates three specified instances of string. More...
 
template<typename char_t , typename ObjectA , typename ObjectB , typename ObjectC >
static std::basic_string< char_t > concat (ObjectA obj_a, ObjectB obj_b, ObjectC obj_c) noexcept
 Concatenates three specified instances of object. More...
 
template<typename ObjectA , typename ObjectB , typename ObjectC >
static std::string concat (ObjectA obj_a, ObjectB obj_b, ObjectC obj_c) noexcept
 Concatenates three specified instances of object. More...
 
template<typename char_t >
static std::basic_string< char_t > concat (const std::basic_string< char_t > &str_a, const std::basic_string< char_t > &str_b) noexcept
 Concatenates two specified instances of string. More...
 
template<typename char_t , typename ObjectA , typename ObjectB >
static std::basic_string< char_t > concat (ObjectA obj_a, ObjectB obj_b) noexcept
 Concatenates two specified instances of object. More...
 
template<typename ObjectA , typename ObjectB >
static std::string concat (const ObjectA &obj_a, const ObjectB &obj_b) noexcept
 Concatenates two specified instances of object. More...
 
template<typename char_t >
static std::basic_string< char_t > concat (const std::vector< std::basic_string< char_t >> &values) noexcept
 Concatenates the elements of a specified string array. More...
 
template<typename char_t , typename Object >
static std::basic_string< char_t > concat (const std::vector< Object > &args) noexcept
 Concatenates the string representations of the elements in a specified Object array. More...
 
template<typename Object >
static std::string concat (const std::vector< Object > &args) noexcept
 Concatenates the string representations of the elements in a specified Object array. More...
 
template<typename char_t , typename Value >
static std::basic_string< char_t > concat (Value value) noexcept
 Creates the string representation of a specified object. More...
 
template<typename Value >
static std::string concat (Value value) noexcept
 Creates the string representation of a specified object. More...
 
template<typename char_t >
static bool contains (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value) noexcept
 Returns a value indicating whether a specified substring occurs within the specified string. More...
 
template<typename char_t >
static std::basic_string< char_t > date_time_format (const std::basic_string< char_t > &fmt, const std::chrono::system_clock::time_point &date_time)
 
template<typename char_t >
static std::basic_string< char_t > date_time_format (const std::basic_string< char_t > &fmt, time_t date_time)
 
template<typename char_t >
static std::basic_string< char_t > date_time_format (const std::basic_string< char_t > &fmt, const std::tm &date_time)
 
static std::string demangle (const std::string &name)
 Gets demangled string of name,. More...
 
template<typename char_t >
static std::basic_string< char_t > empty () noexcept
 Represents the empty string. More...
 
static std::string empty () noexcept
 Represents the empty string. More...
 
template<typename char_t >
static bool ends_with (const std::basic_string< char_t > &str, char_t value) noexcept
 Determines whether the end of the specified string matches the specified char_t. More...
 
template<typename char_t >
static bool ends_with (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value) noexcept
 Determines whether the end of the specified string matches the specified string. More...
 
template<typename char_t >
static bool ends_with (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value, bool ignore_case) noexcept
 Determines whether the end of this string instance matches the specified string when compared using the specified culture. More...
 
template<typename char_t >
static bool ends_with (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value, xtd::string_comparison comparison_type) noexcept
 Determines whether the end of the specified string matches the specified string when compared using the specified comparison option. More...
 
template<typename char_t , typename ... args_t>
static std::basic_string< char_t > format (const std::basic_string< char_t > &fmt, args_t &&... args)
 Writes the text representation of the specified arguments list, to string using the specified format information. More...
 
template<typename char_t , typename ... args_t>
static std::basic_string< char_t > formatf (const std::basic_string< char_t > &fmt, args_t &&... args) noexcept
 Writes the text representation of the specified arguments list, to string using the specified format information. More...
 
template<typename object_t >
static std::string full_class_name ()
 Gets the fully qualified class name of the objec_t, including the namespace of the objec_t. More...
 
template<typename object_t >
static std::string full_class_name (const object_t &object)
 Gets the fully qualified class name of the specified object, including the namespace of the specified object. More...
 
static std::string full_class_name (const std::type_info &info)
 
template<typename char_t >
static size_t get_hash_code (const std::basic_string< char_t > &str) noexcept
 Returns the hash code for this string. More...
 
template<typename char_t >
static size_t index_of (const std::basic_string< char_t > &str, char_t value) noexcept
 Reports the index of the first occurrence of the specified character in the sĂȘcified tring. More...
 
template<typename char_t >
static size_t index_of (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value) noexcept
 Reports the index of the first occurrence of the specified string in the specified string. More...
 
template<typename char_t >
static size_t index_of (const std::basic_string< char_t > &str, char_t value, size_t start_index) noexcept
 Reports the index of the first occurrence of the specified character in the spexified string. The search starts at a specified character position. More...
 
template<typename char_t >
static size_t index_of (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value, size_t start_index) noexcept
 Reports the index of the first occurrence of the specified character in the spexified string. The search starts at a specified character position. More...
 
template<typename char_t >
static size_t index_of (const std::basic_string< char_t > &str, char_t value, size_t start_index, size_t count) noexcept
 Reports the index of the first occurrence of the specified character in the spexified string. The search starts at a specified character position and examines a specified number of character positions. More...
 
template<typename char_t >
static size_t index_of (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value, size_t start_index, size_t count) noexcept
 Reports the index of the first occurrence of the specified character in the spexified string. The search starts at a specified character position and examines a specified number of character positions. More...
 
template<typename char_t >
static size_t index_of_any (const std::basic_string< char_t > &str, const std::vector< char_t > &values) noexcept
 Reports the index of the first occurrence in this instance of any character in a specified array of characters. More...
 
template<typename char_t >
static size_t index_of_any (const std::basic_string< char_t > &str, const std::vector< char_t > &values, size_t start_index) noexcept
 Reports the index of the first occurrence in this instance of any character in a specified array of characters. The search starts at a specified character position. More...
 
template<typename char_t >
static size_t index_of_any (const std::basic_string< char_t > &str, const std::vector< char_t > &values, size_t start_index, size_t count) noexcept
 Reports the index of the first occurrence in this instance of any character in a specified array of characters. The search starts at a specified character position. More...
 
template<typename char_t >
static std::basic_string< char_t > insert (const std::basic_string< char_t > &str, size_t start_index, const std::basic_string< char_t > &value) noexcept
 Inserts a specified instance of String at a specified index position in this instance. More...
 
template<typename char_t >
static bool is_empty (const std::basic_string< char_t > &str)
 Indicates whether the specified string is an empty string (""). More...
 
template<typename char_t , typename Collection >
static std::basic_string< char_t > join (const std::basic_string< char_t > &separator, const Collection &values) noexcept
 Concatenates a specified separator String between each element of a specified Object array, yielding a single concatenated String. More...
 
template<typename char_t , typename Collection >
static std::basic_string< char_t > join (const std::basic_string< char_t > &separator, const Collection &values, size_t index) noexcept
 Concatenates a specified separator String between each element of a specified Object array, yielding a single concatenated String. More...
 
template<typename char_t , typename Collection >
static std::basic_string< char_t > join (const std::basic_string< char_t > &separator, const Collection &values, size_t index, size_t count) noexcept
 Concatenates a specified separator String between each element of a specified Object array, yielding a single concatenated String. More...
 
template<typename char_t >
static size_t last_index_of (const std::basic_string< char_t > &str, char_t value) noexcept
 Reports the index of the last occurrence of the specified character in the sĂȘcified tring. More...
 
template<typename char_t >
static size_t last_index_of (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value) noexcept
 Reports the index of the last occurrence of the specified string in the specified string. More...
 
template<typename char_t >
static size_t last_index_of (const std::basic_string< char_t > &str, char_t value, size_t start_index) noexcept
 Reports the index of the last occurrence of the specified character in the spexified string. The search starts at a specified character position. More...
 
template<typename char_t >
static size_t last_index_of (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value, size_t start_index) noexcept
 Reports the index of the last occurrence of the specified character in the spexified string. The search starts at a specified character position. More...
 
template<typename char_t >
static size_t last_index_of (const std::basic_string< char_t > &str, char_t value, size_t start_index, size_t count) noexcept
 Reports the index of the last occurrence of the specified character in the spexified string. The search starts at a specified character position and examines a specified number of character positions. More...
 
template<typename char_t >
static size_t last_index_of (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value, size_t start_index, size_t count) noexcept
 Reports the index of the last occurrence of the specified character in the spexified string. The search starts at a specified character position and examines a specified number of character positions. More...
 
template<typename char_t >
static size_t last_index_of_any (const std::basic_string< char_t > &str, const std::vector< char_t > &values) noexcept
 Reports the index of the last occurrence in this instance of any character in a specified array of characters. More...
 
template<typename char_t >
static size_t last_index_of_any (const std::basic_string< char_t > &str, const std::vector< char_t > &values, size_t start_index) noexcept
 Reports the index of the last occurrence in this instance of any character in a specified array of characters. The search starts at a specified character position. More...
 
template<typename char_t >
static size_t last_index_of_any (const std::basic_string< char_t > &str, const std::vector< char_t > &values, size_t start_index, size_t count) noexcept
 Reports the index of the last occurrence in this instance of any character in a specified array of characters. The search starts at a specified character position. More...
 
template<typename char_t >
static std::basic_string< char_t > pad_left (const std::basic_string< char_t > &str, size_t total_width) noexcept
 Right-aligns the characters iin the specified string, padding with spaces on the left for a specified total length. More...
 
template<typename char_t >
static std::basic_string< char_t > pad_left (const std::basic_string< char_t > &str, size_t total_width, char_t padding_char) noexcept
 Right-aligns the characters in the specified string, padding with spaces on the left for a specified total length. More...
 
template<typename char_t >
static std::basic_string< char_t > pad_right (const std::basic_string< char_t > &str, size_t total_width) noexcept
 Left-aligns the characters in the specified string, padding with spaces on the right for a specified total length. More...
 
template<typename char_t >
static std::basic_string< char_t > pad_right (const std::basic_string< char_t > &str, size_t total_width, char_t padding_char) noexcept
 Left-aligns the characters in the specified string, padding with spaces on the right for a specified total length. More...
 
template<typename Value >
static Value parse (const std::string &str)
 
template<typename char_t >
static std::basic_string< char_t > remove (const std::basic_string< char_t > &str, size_t start_index) noexcept
 Deletes all the characters from this String beginning at a specified position and continuing through the last position. More...
 
template<typename char_t >
static std::basic_string< char_t > remove (const std::basic_string< char_t > &str, size_t start_index, size_t count) noexcept
 Deletes all the characters from this String beginning at a specified position and continuing through the last position. More...
 
template<typename char_t >
static std::basic_string< char_t > replace (const std::basic_string< char_t > &str, char_t old_char, char_t new_char) noexcept
 Replaces all occurrences of a specified char_t in the specified string with another specified char_t. More...
 
template<typename char_t >
static std::basic_string< char_t > replace (const std::basic_string< char_t > &str, const std::basic_string< char_t > &old_string, const std::basic_string< char_t > &new_string) noexcept
 Replaces all occurrences of a specified String in the specified string with another specified String. More...
 
template<typename char_t >
static std::vector< std::basic_string< char_t > > split (const std::basic_string< char_t > &str, const std::vector< char_t > &separators, size_t count, string_split_options options) noexcept
 Splits a specified string into a maximum number of substrings based on the characters in an array. More...
 
template<typename char_t >
static std::vector< std::basic_string< char_t > > split (const std::basic_string< char_t > &str) noexcept
 Splits a specified string into substrings that are based on the default white-space characters. White-space characters are defined by the c++ standard and return true if they are passed to the std::isspace() or std::iswspace() method. More...
 
template<typename char_t >
static std::vector< std::basic_string< char_t > > split (const std::basic_string< char_t > &str, const std::vector< char_t > &separators) noexcept
 Splits a specified string into substrings that are based on the characters in an array. More...
 
template<typename char_t >
static std::vector< std::basic_string< char_t > > split (const std::basic_string< char_t > &str, const std::vector< char_t > &separators, string_split_options options) noexcept
 Splits a specified string into substrings based on the characters in an array. You can specify whether the substrings include empty array elements. More...
 
template<typename char_t >
static std::vector< std::basic_string< char_t > > split (const std::basic_string< char_t > &str, const std::vector< char_t > &separators, size_t count) noexcept
 
template<typename char_t >
static bool starts_with (const std::basic_string< char_t > &str, char_t value) noexcept
 Determines whether the beginning of an instance of String matches a specified String. More...
 
template<typename char_t >
static bool starts_with (const std::basic_string< char_t > &str, char_t value, bool ignore_case) noexcept
 Determines whether the beginning of an instance of String matches a specified String, ignoring or honoring their case. More...
 
template<typename char_t >
static bool starts_with (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value) noexcept
 Determines whether the beginning of an instance of String matches a specified String. More...
 
template<typename char_t >
static bool starts_with (const std::basic_string< char_t > &str, const std::basic_string< char_t > &value, bool ignore_case) noexcept
 Determines whether the beginning of an instance of String matches a specified String, ignoring or honoring their case. More...
 
template<typename char_t >
static std::basic_string< char_t > substring (const std::basic_string< char_t > &str, size_t start_index) noexcept
 Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length. More...
 
template<typename char_t >
static std::basic_string< char_t > substring (const std::basic_string< char_t > &str, size_t start_index, size_t length) noexcept
 Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length. More...
 
template<typename char_t >
static const std::vector< char_t > to_array (const std::basic_string< char_t > &str) noexcept
 Copies the characters in this instance to a Unicode character array. More...
 
template<typename char_t >
static const std::vector< char_t > to_array (const std::basic_string< char_t > &str, size_t start_index) noexcept
 Copies the characters in this instance to a Unicode character array starting at specitied index. More...
 
template<typename char_t >
static const std::vector< char_t > to_array (const std::basic_string< char_t > &str, size_t start_index, size_t length) noexcept
 Copies the characters in this instance to a Unicode character array starting at specitied index with specified legnth. More...
 
template<typename char_t >
static const std::basic_string< char_t > to_lower (const std::basic_string< char_t > &str) noexcept
 Returns a copy of the specified string converted to lowercase. More...
 
template<typename char_t >
static const std::basic_string< char_t > to_upper (const std::basic_string< char_t > &str) noexcept
 Returns a copy of the specified string converted to uppercase. More...
 
template<typename char_t >
static std::basic_string< char_t > trim (const std::basic_string< char_t > &str) noexcept
 Removes all leading and trailing occurrences of white-space characters from the specifed String. More...
 
template<typename char_t >
static std::basic_string< char_t > trim (const std::basic_string< char_t > &str, char_t trim_char) noexcept
 Removes all eading and trailing occurrences of a character specified from the specifed String . More...
 
template<typename char_t >
static std::basic_string< char_t > trim (const std::basic_string< char_t > &str, const std::vector< char_t > &trim_chars) noexcept
 Removes all eading and trailing occurrences of a set of characters specified in an array from the specified String. More...
 
template<typename char_t >
static std::basic_string< char_t > trim_end (const std::basic_string< char_t > &str) noexcept
 Removes all trailing occurrences of white-space characters from the specifed String. More...
 
template<typename char_t >
static std::basic_string< char_t > trim_end (const std::basic_string< char_t > &str, char_t trim_char) noexcept
 Removes all trailing occurrences of a character specified from the specifed String . More...
 
template<typename char_t >
static std::basic_string< char_t > trim_end (const std::basic_string< char_t > &str, const std::vector< char_t > &trim_chars) noexcept
 Removes all trailing occurrences of a set of characters specified in an array from the specified String. More...
 
template<typename char_t >
static std::basic_string< char_t > trim_start (const std::basic_string< char_t > &str) noexcept
 Removes all leading occurrences of white-space characters from the specifed String. More...
 
template<typename char_t >
static std::basic_string< char_t > trim_start (const std::basic_string< char_t > &str, char_t trim_char) noexcept
 Removes all leading occurrences of a character specified from the specifed String . More...
 
template<typename char_t >
static std::basic_string< char_t > trim_start (const std::basic_string< char_t > &str, const std::vector< char_t > &trim_chars) noexcept
 Removes all leading occurrences of a set of characters specified in an array from the specified String. More...
 
template<typename Value >
static bool try_parse (const std::string &str, Value &value)
 

Detailed Description

The strings Caintains string operation methods.


The documentation for this class was generated from the following file: