xtd.string - Reference Guide  0.1.1
Modern c++17 library to add string utilities on Windows, macOS, Linux, iOS and android.
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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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
 Splits a specified string into a maximum number of substrings based on the characters in an array. More...
 
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. 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. 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.

Member Function Documentation

§ class_name() [1/2]

template<typename object_t >
static std::string xtd::strings::class_name ( )
inlinestatic

Gets the class name of the object_t.

Returns
The class name of the object_t.
Remarks
For example, the name of the strings type is strings.

§ class_name() [2/2]

template<typename object_t >
static std::string xtd::strings::class_name ( const object_t &  object)
inlinestatic

Gets the class name of the specified object.

Returns
The class name of the specified object.
Remarks
For example, the name of the strings type is strings.

§ compare() [1/6]

template<typename char_t >
static int xtd::strings::compare ( const std::basic_string< char_t > &  str_a,
const std::basic_string< char_t > &  str_b 
)
inlinestaticnoexcept

Compares two specified String objects and returns an integer that indicates their relative position in the sort order.

Parameters
str_aThe first string to compare.
str_bThe second string to compare.
Returns
A 32-bit signed integer that indicates the lexical relationship between the two comparands.
Value Condition
Less than zero str_a precedes str_b in the sort order.
Zero str_a occurs in the same position as str_b in the sort order.
Greater than zero str_a follows str_b in the sort order.

§ compare() [2/6]

template<typename char_t >
static int xtd::strings::compare ( const std::basic_string< char_t > &  str_a,
const std::basic_string< char_t > &  str_b,
bool  ignore_case 
)
inlinestaticnoexcept

Compares two specified String objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order.

Parameters
str_aThe first string to compare.
str_bThe second string to compare.
ignore_casetrue to ignore case during the comparison; otherwise, false.
Returns
A 32-bit signed integer that indicates the lexical relationship between the two comparands.
Value Condition
Less than zero str_a precedes str_b in the sort order.
Zero str_a occurs in the same position as str_b in the sort order.
Greater than zero str_a follows str_b in the sort order.

§ compare() [3/6]

template<typename char_t >
static int xtd::strings::compare ( const std::basic_string< char_t > &  str_a,
const std::basic_string< char_t > &  str_b,
xtd::string_comparison  comparison_type 
)
inlinestaticnoexcept

Compares two specified String objects using the specified rules, and returns an integer that indicates their relative position in the sort order.

Parameters
str_aThe first string to compare.
str_bThe second string to compare.
comparison_typeOne of the enumeration values that specifies the rules to use in the comparison.
Returns
A 32-bit signed integer that indicates the lexical relationship between the two comparands.
Value Condition
Less than zero str_a precedes str_b in the sort order.
Zero str_a occurs in the same position as str_b in the sort order.
Greater than zero str_a follows str_b in the sort order.

§ compare() [4/6]

template<typename char_t >
static int xtd::strings::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 
)
inlinestaticnoexcept

Compares substrings of two specified String objects and returns an integer that indicates their relative position in the sort order.

Parameters
str_aThe first string to use in the comparison.
index_aThe position of the substring within str_a.
str_bThe second string to use in the comparison.
index_bThe position of the substring within str_b.
lengthThe maximum number of characters in the substrings to compare
Returns
A 32-bit signed integer that indicates the lexical relationship between the two comparands.
Value Condition
Less than zero str_a precedes str_b in the sort order.
Zero str_a occurs in the same position as str_b in the sort order.
Greater than zero str_a follows str_b in the sort order.

§ compare() [5/6]

template<typename char_t >
static int xtd::strings::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 
)
inlinestaticnoexcept

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.

Parameters
str_aThe first string to use in the comparison.
index_aThe position of the substring within str_a.
str_bThe second string to use in the comparison.
index_bThe position of the substring within str_b.
lengthThe maximum number of characters in the substrings to compare
ignore_casetrue to ignore case during the comparison; otherwise, false.
Returns
A 32-bit signed integer that indicates the lexical relationship between the two comparands.
Value Condition
Less than zero str_a precedes str_b in the sort order.
Zero str_a occurs in the same position as str_b in the sort order.
Greater than zero str_a follows str_b in the sort order.

§ compare() [6/6]

template<typename char_t >
static int xtd::strings::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 
)
inlinestaticnoexcept

Compares substrings of two specified String objects using the specified rules, and returns an integer that indicates their relative position in the sort order.

Parameters
str_aThe first string to use in the comparison.
index_aThe position of the substring within str_a.
str_bThe second string to use in the comparison.
index_bThe position of the substring within str_b.
lengthThe maximum number of characters in the substrings to compare
comparison_typeOne of the enumeration values that specifies the rules to use in the comparison.
Returns
A 32-bit signed integer that indicates the lexical relationship between the two comparands.
Value Condition
Less than zero str_a precedes str_b in the sort order.
Zero str_a occurs in the same position as str_b in the sort order.
Greater than zero str_a follows str_b in the sort order.

§ concat() [1/14]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::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 
)
inlinestaticnoexcept

Concatenates four specified instances of string.

Parameters
str_aThe first string to concatenate.
str_bThe second string to concatenate.
str_cThe third string to concatenate.
str_dThe fourth string to concatenate.
Returns
The concatenation of str_a, str_b, str_c and str_d.

§ concat() [2/14]

template<typename char_t , typename ObjectA , typename ObjectB , typename ObjectC , typename ObjectD >
static std::basic_string<char_t> xtd::strings::concat ( ObjectA  obj_a,
ObjectB  obj_b,
ObjectC  obj_c,
ObjectD  obj_d 
)
inlinestaticnoexcept

Concatenates four specified instances of object.

Parameters
obj_aThe first object to concatenate.
obj_bThe second object to concatenate.
obj_cThe third object to concatenate.
obj_dThe fourth object to concatenate.
Returns
The concatenation of obj_a, obj_b, obj_c and obj_d.

§ concat() [3/14]

template<typename ObjectA , typename ObjectB , typename ObjectC , typename ObjectD >
static std::string xtd::strings::concat ( ObjectA  obj_a,
ObjectB  obj_b,
ObjectC  obj_c,
ObjectD  obj_d 
)
inlinestaticnoexcept

Concatenates four specified instances of object.

Parameters
obj_aThe first object to concatenate.
obj_bThe second object to concatenate.
obj_cThe third object to concatenate.
obj_dThe fourth object to concatenate.
Returns
The concatenation of obj_a, obj_b, obj_c and obj_d.

§ concat() [4/14]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::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 
)
inlinestaticnoexcept

Concatenates three specified instances of string.

Parameters
str_aThe first string to concatenate.
str_bThe second string to concatenate.
str_cThe third string to concatenate.
Returns
String The concatenation of str_a, str_b and str_c.

§ concat() [5/14]

template<typename char_t , typename ObjectA , typename ObjectB , typename ObjectC >
static std::basic_string<char_t> xtd::strings::concat ( ObjectA  obj_a,
ObjectB  obj_b,
ObjectC  obj_c 
)
inlinestaticnoexcept

Concatenates three specified instances of object.

Parameters
obj_aThe first object to concatenate.
obj_bThe second object to concatenate.
obj_cThe third object to concatenate.
Returns
The concatenation of obj_a, obj_b and obj_c.

§ concat() [6/14]

template<typename ObjectA , typename ObjectB , typename ObjectC >
static std::string xtd::strings::concat ( ObjectA  obj_a,
ObjectB  obj_b,
ObjectC  obj_c 
)
inlinestaticnoexcept

Concatenates three specified instances of object.

Parameters
obj_aThe first object to concatenate.
obj_bThe second object to concatenate.
obj_cThe third object to concatenate.
Returns
The concatenation of obj_a, obj_b and obj_c.

§ concat() [7/14]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::concat ( const std::basic_string< char_t > &  str_a,
const std::basic_string< char_t > &  str_b 
)
inlinestaticnoexcept

Concatenates two specified instances of string.

Parameters
str_aThe first string to concatenate.
str_bThe second string to concatenate.
Returns
String The concatenation of str_a and str_b.

§ concat() [8/14]

template<typename char_t , typename ObjectA , typename ObjectB >
static std::basic_string<char_t> xtd::strings::concat ( ObjectA  obj_a,
ObjectB  obj_b 
)
inlinestaticnoexcept

Concatenates two specified instances of object.

Parameters
obj_aThe first object to concatenate.
obj_bThe second object to concatenate.
Returns
The concatenation of obj_a and obj_b.

§ concat() [9/14]

template<typename ObjectA , typename ObjectB >
static std::string xtd::strings::concat ( const ObjectA &  obj_a,
const ObjectB &  obj_b 
)
inlinestaticnoexcept

Concatenates two specified instances of object.

Parameters
obj_aThe first object to concatenate.
obj_bThe second object to concatenate.
Returns
The concatenation of obj_a and obj_b.

§ concat() [10/14]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::concat ( const std::vector< std::basic_string< char_t >> &  values)
inlinestaticnoexcept

Concatenates the elements of a specified string array.

Parameters
valuesAn array of string instances.
Returns
The concatenated elements of values.

§ concat() [11/14]

template<typename char_t , typename Object >
static std::basic_string<char_t> xtd::strings::concat ( const std::vector< Object > &  args)
inlinestaticnoexcept

Concatenates the string representations of the elements in a specified Object array.

Parameters
argsAn object array that contains the elements to concatenate.
Returns
The concatenated string representations of the values of the elements in args.

§ concat() [12/14]

template<typename Object >
static std::string xtd::strings::concat ( const std::vector< Object > &  args)
inlinestaticnoexcept

Concatenates the string representations of the elements in a specified Object array.

Parameters
argsAn object array that contains the elements to concatenate.
Returns
The concatenated string representations of the values of the elements in args.

§ concat() [13/14]

template<typename char_t , typename Value >
static std::basic_string<char_t> xtd::strings::concat ( Value  value)
inlinestaticnoexcept

Creates the string representation of a specified object.

Parameters
obj_aThe object to represent.
Returns
The string representation of the value of arg0.

§ concat() [14/14]

template<typename Value >
static std::string xtd::strings::concat ( Value  value)
inlinestaticnoexcept

Creates the string representation of a specified object.

Parameters
obj_aThe object to represent.
Returns
The string representation of the value of arg0.

§ contains()

template<typename char_t >
static bool xtd::strings::contains ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value 
)
inlinestaticnoexcept

Returns a value indicating whether a specified substring occurs within the specified string.

Parameters
strThe string to check.
valueThe string to seek.
Returns
true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false.

§ demangle()

static std::string xtd::strings::demangle ( const std::string &  name)
inlinestatic

Gets demangled string of name,.

Returns
The demangled string of name.

§ empty() [1/2]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::empty ( )
inlinestaticnoexcept

Represents the empty string.

Remarks
The value of this method is the zero-length string, "".

§ empty() [2/2]

static std::string xtd::strings::empty ( )
inlinestaticnoexcept

Represents the empty string.

Remarks
The value of this method is the zero-length string, "".

§ ends_with() [1/4]

template<typename char_t >
static bool xtd::strings::ends_with ( const std::basic_string< char_t > &  str,
char_t  value 
)
inlinestaticnoexcept

Determines whether the end of the specified string matches the specified char_t.

Parameters
strThe string to match.
valueThe char_t to compare to the substring at the end of this instance.
Returns
true if value matches the end of this instance; otherwise, false.

§ ends_with() [2/4]

template<typename char_t >
static bool xtd::strings::ends_with ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value 
)
inlinestaticnoexcept

Determines whether the end of the specified string matches the specified string.

Parameters
strThe string to match.
valueThe string to compare to the substring at the end of this instance.
Returns
true if value matches the end of this instance; otherwise, false.

§ ends_with() [3/4]

template<typename char_t >
static bool xtd::strings::ends_with ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value,
bool  ignore_case 
)
inlinestaticnoexcept

Determines whether the end of this string instance matches the specified string when compared using the specified culture.

Parameters
strThe string to match.
ignore_casetrue to ignore case during the comparison; otherwise, false.
Returns
bool true if value matches the end of the specified string; otherwise, false.

§ ends_with() [4/4]

template<typename char_t >
static bool xtd::strings::ends_with ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value,
xtd::string_comparison  comparison_type 
)
inlinestaticnoexcept

Determines whether the end of the specified string matches the specified string when compared using the specified comparison option.

Parameters
strThe string to match.
comparison_typeOne of the enumeration values that determines how this string and value are compared.
Returns
bool true if value matches the end of the specified string; otherwise, false.

§ format()

template<typename char_t , typename ... args_t>
static std::basic_string<char_t> xtd::strings::format ( const std::basic_string< char_t > &  fmt,
args_t &&...  args 
)
inlinestatic

Writes the text representation of the specified arguments list, to string using the specified format information.

Parameters
fmtA composite format string.
argsanarguments list to write using format.
Returns
string formated.
Remarks
for more information about format see Format.

§ formatf()

template<typename char_t , typename ... args_t>
static std::basic_string<char_t> xtd::strings::formatf ( const std::basic_string< char_t > &  fmt,
args_t &&...  args 
)
inlinestaticnoexcept

Writes the text representation of the specified arguments list, to string using the specified format information.

Parameters
fmtA composite format string.
argsanarguments list to write using format.
Returns
string formated.
Remarks
A format specifier follows this prototype:
%[flags][width][.precision][length]specifier
specifier Output Example
d or i Signed decimal integer 392
u Unsigned decimal integer 7235
o Unsigned octal 610
x Unsigned hexadecimal integer 7fa
X Unsigned hexadecimal integer (uppercase) 7FA
f Decimal floating point, lowercase 392.65
F Decimal floating point, lowercase (uppercase) 392.65
e Scientific notation (mantissa/exponent), lowercase 3.9265e+2
E Scientific notation (mantissa/exponent), uppercase 3.9265E+2
g Use the shortest representation: e or f 392.65
G Use the shortest representation: E or F 392.65
a Hexadecimal floating point, lowercase -0xc.90fep-2
A Hexadecimal floating point, uppercase -0XC.90FEP-2
c Character a
s String of characters sample
p Pointer address b8000000
n Nothing printed. The corresponding argument must be a pointer to a signed int. The number of characters written so far is stored in the pointed location
% A % followed by another % character will write a single % to the stream. %
The format specifier can also contain sub-specifiers: flags, width, .precision and modifiers (in that order), which are optional and follow these specifications:
flags description
- Left-justify within the given field width; Right justification is the default (see width sub-specifier).
+ Forces to preceed the result with a plus or minus sign (+ or -) even for positive numbers. By default, only negative numbers are preceded with a - sign.
(space) If no sign is going to be written, a blank space is inserted before the value.
# Used with o, x or X specifiers the value is preceeded with 0, 0x or 0X respectively for values different than zero. Used with a, A, e, E, f, F, g or G it forces the written output to contain a decimal point even if no more digits follow. By default, if no digits follow, no decimal point is written.
0 Left-pads the number with zeroes (0) instead of spaces when padding is specified (see width sub-specifier).
width description
(number) Minimum number of characters to be printed. If the value to be printed is shorter than this number, the result is padded with blank spaces. The value is not truncated even if the result is larger.
*  The width is not specified in the format string, but as an additional integer value argument preceding the argument that has to be formatted.
.precision description
.number For integer specifiers (d, i, o, u, x, X): precision specifies the minimum number of digits to be written. If the value to be written is shorter than this number, the result is padded with leading zeros. The value is not truncated even if the result is longer. A precision of 0 means that no character is written for the value 0. For a, A, e, E, f and F specifiers: this is the number of digits to be printed after the decimal point (by default, this is 6). For g and G specifiers: This is the maximum number of significant digits to be printed. For s: this is the maximum number of characters to be printed. By default all characters are printed until the ending null character is encountered. If the period is specified without an explicit value for precision, 0 is assumed.
.* The precision is not specified in the format string, but as an additional integer value argument preceding the argument that has to be formatted.
The length sub-specifier modifies the length of the data type. This is a chart showing the types used to interpret the corresponding arguments with and without length specifier (if a different type is used, the proper type promotion or conversion is performed, if allowed):
length d i u o x X f F e E g G a A c s p n
(none) int unsigned int double int  char* void* int*
hh signed char unsigned char     unsigned char*
h short int unsigned short int     short int*
l long int unsigned long int win_t wchar_t* long int*
ll long long int unsigned long long int   long long int*
j intmax_t uintmax_t   intmax_t*
z  size_t size_t   size_t*
t  ptrdiff_t ptrdiff_t   ptrdiff_t*
L long double      
Note regarding the c specifier: it takes an int (or wint_t) as argument, but performs the proper conversion to a char value (or a wchar_t) before formatting it for output.
you can use std::string or std::wstring with format param %s.

§ full_class_name() [1/2]

template<typename object_t >
static std::string xtd::strings::full_class_name ( )
inlinestatic

Gets the fully qualified class name of the objec_t, including the namespace of the objec_t.

Returns
The fully qualified class name of the objec_t, including the namespace of the objec_t.
Remarks
For example, the fully qualified name of the strings type is xtd::strings.

§ full_class_name() [2/2]

template<typename object_t >
static std::string xtd::strings::full_class_name ( const object_t &  object)
inlinestatic

Gets the fully qualified class name of the specified object, including the namespace of the specified object.

Returns
The fully qualified class name of the objec_t, including the namespace of the specified object.
Remarks
For example, the fully qualified name of the strings type is xtd::strings.

§ get_hash_code()

template<typename char_t >
static size_t xtd::strings::get_hash_code ( const std::basic_string< char_t > &  str)
inlinestaticnoexcept

Returns the hash code for this string.

Returns
A hash code.

§ index_of() [1/6]

template<typename char_t >
static size_t xtd::strings::index_of ( const std::basic_string< char_t > &  str,
char_t  value 
)
inlinestaticnoexcept

Reports the index of the first occurrence of the specified character in the sêcified tring.

Parameters
strA String to find index of.
valueA Unicode character to seek
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ index_of() [2/6]

template<typename char_t >
static size_t xtd::strings::index_of ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value 
)
inlinestaticnoexcept

Reports the index of the first occurrence of the specified string in the specified string.

Parameters
strA String to find index of.
valueA Unicode character to seek
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ index_of() [3/6]

template<typename char_t >
static size_t xtd::strings::index_of ( const std::basic_string< char_t > &  str,
char_t  value,
size_t  start_index 
)
inlinestaticnoexcept

Reports the index of the first occurrence of the specified character in the spexified string.

The search starts at a specified character position.

Parameters
strA String to find index of.
valueA Unicode character to seek
start_indexThe search starting position
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ index_of() [4/6]

template<typename char_t >
static size_t xtd::strings::index_of ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value,
size_t  start_index 
)
inlinestaticnoexcept

Reports the index of the first occurrence of the specified character in the spexified string.

The search starts at a specified character position.

Parameters
strA String to find index of.
valueA Unicode character to seek
start_indexThe search starting position
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ index_of() [5/6]

template<typename char_t >
static size_t xtd::strings::index_of ( const std::basic_string< char_t > &  str,
char_t  value,
size_t  start_index,
size_t  count 
)
inlinestaticnoexcept

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.

Parameters
strA String to find index of.
valueA Unicode character to seek
start_indexThe search starting position
countThe number of character positions to examine
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ index_of() [6/6]

template<typename char_t >
static size_t xtd::strings::index_of ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value,
size_t  start_index,
size_t  count 
)
inlinestaticnoexcept

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.

Parameters
strA String to find index of.
valueA Unicode character to seek
start_indexThe search starting position
countThe number of character positions to examine
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ index_of_any() [1/3]

template<typename char_t >
static size_t xtd::strings::index_of_any ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  values 
)
inlinestaticnoexcept

Reports the index of the first occurrence in this instance of any character in a specified array of characters.

Parameters
strA String to find index of any.
valuesA Unicode character array containing one or more characters to seek
Returns
size_t The index position of the first occurrence in this instance where any character in values was found; otherwise, std::basic_string<char_t>::npos if no character in values was found.

§ index_of_any() [2/3]

template<typename char_t >
static size_t xtd::strings::index_of_any ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  values,
size_t  start_index 
)
inlinestaticnoexcept

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.

Parameters
strA String to find index of any.
valuesA Unicode character array containing one or more characters to seek
start_indexThe search starting position
Returns
size_t The index position of the first occurrence in this instance where any character in values was found; otherwise, std::basic_string<char_t>::npos if no character in values was found.

§ index_of_any() [3/3]

template<typename char_t >
static size_t xtd::strings::index_of_any ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  values,
size_t  start_index,
size_t  count 
)
inlinestaticnoexcept

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.

Parameters
strA String to find index of any.
valuesA Unicode character array containing one or more characters to seek
start_indexThe search starting position
countThe number of character positions to examine.
Returns
size_t The index position of the first occurrence in this instance where any character in values was found; otherwise, std::basic_string<char_t>::npos if no character in values was found.

§ insert()

template<typename char_t >
static std::basic_string<char_t> xtd::strings::insert ( const std::basic_string< char_t > &  str,
size_t  start_index,
const std::basic_string< char_t > &  value 
)
inlinestaticnoexcept

Inserts a specified instance of String at a specified index position in this instance.

Parameters
start_indexThe index position of the insertion.
valueThe String to insert.
Returns
String A new String equivalent to this instance but with value inserted at position start_index.
Remarks
If start_index is equal to the length of this instance, value is appended to the end of this instance.
For example, the return value of "abc".Insert(2, "XYZ") is "abXYZc".

§ is_empty()

template<typename char_t >
static bool xtd::strings::is_empty ( const std::basic_string< char_t > &  str)
inlinestatic

Indicates whether the specified string is an empty string ("").

Parameters
strThe string to test.
Returns
true if the value parameter is null or an empty string (""); otherwise, false.

§ join() [1/3]

template<typename char_t , typename Collection >
static std::basic_string<char_t> xtd::strings::join ( const std::basic_string< char_t > &  separator,
const Collection &  values 
)
inlinestaticnoexcept

Concatenates a specified separator String between each element of a specified Object array, yielding a single concatenated String.

Parameters
separatorA String separator.
valuesAn array of Object.
Returns
A String consisting of the elements of value interspersed with the separator String.
Remarks
For example if separator is ", " and the elements of value are "red", "blue", "green", and "yellow", Join(separator, value) returns "red, blue, green, yellow".
stream << operator is called on each object to generate the content.

§ join() [2/3]

template<typename char_t , typename Collection >
static std::basic_string<char_t> xtd::strings::join ( const std::basic_string< char_t > &  separator,
const Collection &  values,
size_t  index 
)
inlinestaticnoexcept

Concatenates a specified separator String between each element of a specified Object array, yielding a single concatenated String.

Parameters
separatorA String separator.
valuesAn array of Object.
start_indexThe first array element in value to use.
Returns
A String consisting of the elements of value interspersed with the separator String.
Remarks
For example if separator is ", " and the elements of value are "red", "blue", "green", and "yellow", Join(separator, value) returns "red, blue, green, yellow".
stream << operator is called on each object to generate the content.

§ join() [3/3]

template<typename char_t , typename Collection >
static std::basic_string<char_t> xtd::strings::join ( const std::basic_string< char_t > &  separator,
const Collection &  values,
size_t  index,
size_t  count 
)
inlinestaticnoexcept

Concatenates a specified separator String between each element of a specified Object array, yielding a single concatenated String.

Parameters
separatorA String separator.
valuesAn array of Object.
start_indexThe first array element in value to use.
countThe number of elements of value to use.
Returns
A String consisting of the elements of value interspersed with the separator String.
Remarks
For example if separator is ", " and the elements of value are "red", "blue", "green", and "yellow", Join(separator, value) returns "red, blue, green, yellow".
stream << operator is called on each object to generate the content.

§ last_index_of() [1/6]

template<typename char_t >
static size_t xtd::strings::last_index_of ( const std::basic_string< char_t > &  str,
char_t  value 
)
inlinestaticnoexcept

Reports the index of the last occurrence of the specified character in the sêcified tring.

Parameters
strA String to find last index of.
valueA Unicode character to seek
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ last_index_of() [2/6]

template<typename char_t >
static size_t xtd::strings::last_index_of ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value 
)
inlinestaticnoexcept

Reports the index of the last occurrence of the specified string in the specified string.

Parameters
strA String to find last index of.
valueA Unicode character to seek
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ last_index_of() [3/6]

template<typename char_t >
static size_t xtd::strings::last_index_of ( const std::basic_string< char_t > &  str,
char_t  value,
size_t  start_index 
)
inlinestaticnoexcept

Reports the index of the last occurrence of the specified character in the spexified string.

The search starts at a specified character position.

Parameters
strA String to find last index of.
valueA Unicode character to seek
start_indexThe search starting position
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ last_index_of() [4/6]

template<typename char_t >
static size_t xtd::strings::last_index_of ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value,
size_t  start_index 
)
inlinestaticnoexcept

Reports the index of the last occurrence of the specified character in the spexified string.

The search starts at a specified character position.

Parameters
strA String to find last index of.
valueA Unicode character to seek
start_indexThe search starting position
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ last_index_of() [5/6]

template<typename char_t >
static size_t xtd::strings::last_index_of ( const std::basic_string< char_t > &  str,
char_t  value,
size_t  start_index,
size_t  count 
)
inlinestaticnoexcept

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.

Parameters
strA String to find last index of.
valueA Unicode character to seek
start_indexThe search starting position
countThe number of character positions to examine
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ last_index_of() [6/6]

template<typename char_t >
static size_t xtd::strings::last_index_of ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value,
size_t  start_index,
size_t  count 
)
inlinestaticnoexcept

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.

Parameters
strA String to find last index of.
valueA Unicode character to seek
start_indexThe search starting position
countThe number of character positions to examine
Returns
size_t The index position of value if that character is found, or std::basic_string<char_t>::npos if it is not.

§ last_index_of_any() [1/3]

template<typename char_t >
static size_t xtd::strings::last_index_of_any ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  values 
)
inlinestaticnoexcept

Reports the index of the last occurrence in this instance of any character in a specified array of characters.

Parameters
strA String to find last index of any.
valuesA Unicode character array containing one or more characters to seek
Returns
size_t The index position of the first occurrence in this instance where any character in values was found; otherwise, std::basic_string<char_t>::npos if no character in values was found.

§ last_index_of_any() [2/3]

template<typename char_t >
static size_t xtd::strings::last_index_of_any ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  values,
size_t  start_index 
)
inlinestaticnoexcept

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.

Parameters
strA String to find index of any.
valuesA Unicode character array containing one or more characters to seek
start_indexThe search starting position
Returns
size_t The index position of the first occurrence in this instance where any character in values was found; otherwise, std::basic_string<char_t>::npos if no character in values was found.

§ last_index_of_any() [3/3]

template<typename char_t >
static size_t xtd::strings::last_index_of_any ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  values,
size_t  start_index,
size_t  count 
)
inlinestaticnoexcept

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.

Parameters
strA String to find last index of any.
valuesA Unicode character array containing one or more characters to seek
start_indexThe search starting position
countThe number of character positions to examine.
Returns
size_t The index position of the first occurrence in this instance where any character in values was found; otherwise, std::basic_string<char_t>::npos if no character in values was found.

§ pad_left() [1/2]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::pad_left ( const std::basic_string< char_t > &  str,
size_t  total_width 
)
inlinestaticnoexcept

Right-aligns the characters iin the specified string, padding with spaces on the left for a specified total length.

Parameters
strString to pad left.
total_widthThe number of characters in the resulting String, equal to the number of original characters plus any additional padding characters.
Returns
String A new String that is equivalent to the specified string, but right-aligned and padded on the left with as many spaces as needed to create a length of total_width. Or, if total_width is less than the length of the specified string, a new String object that is identical to the specified string.
Remarks
A Unicode space is defined as hexadecimal 0x20.
The pad_left(const std::basic_string<char_t>&, int) method pads the beginning of the returned String. This means that, when used with right-to-left languages, it pads the right portion of the String..

§ pad_left() [2/2]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::pad_left ( const std::basic_string< char_t > &  str,
size_t  total_width,
char_t  padding_char 
)
inlinestaticnoexcept

Right-aligns the characters in the specified string, padding with spaces on the left for a specified total length.

Parameters
strString to pad left.
total_widthThe number of characters in the resulting String, equal to the number of original characters plus any additional padding characters.
paddingCharA Unicode padding character.
Returns
String A new String that is equivalent to the specified string, but right-aligned and padded on the left with as many spaces as needed to create a length of total_width. Or, if total_width is less than the length of the specified string, a new String object that is identical the specified string.
Remarks
A Unicode space is defined as hexadecimal 0x20.
The pad_left(const std::basic_string<char_t>&, int) method pads the beginning of the returned String. This means that, when used with right-to-left languages, it pads the right portion of the String..

§ pad_right() [1/2]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::pad_right ( const std::basic_string< char_t > &  str,
size_t  total_width 
)
inlinestaticnoexcept

Left-aligns the characters in the specified string, padding with spaces on the right for a specified total length.

Parameters
strString to pad right.
totalWidthThe number of characters in the resulting String, equal to the number of original characters plus any additional padding characters.
Returns
String A new String that is equivalent to the specified string, but left-aligned and padded on the right with as many spaces as needed to create a length of totalWidth. Or, if totalWidth is less than the length of the specified string, a new String object that is identical to the specified string.
Remarks
A Unicode space is defined as hexadecimal 0x20.
The PadRight(const std::basic_string<char_t>&, int) method pads the end of the returned String. This means that, when used with right-to-left languages, it pads the left portion of the String..

§ pad_right() [2/2]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::pad_right ( const std::basic_string< char_t > &  str,
size_t  total_width,
char_t  padding_char 
)
inlinestaticnoexcept

Left-aligns the characters in the specified string, padding with spaces on the right for a specified total length.

Parameters
strString to pad right.
totalWidthThe number of characters in the resulting String, equal to the number of original characters plus any additional padding characters.
paddingCharA Unicode padding character.
Returns
String A new String that is equivalent to the specified string, but left-aligned and padded on the tight with as many spaces as needed to create a length of totalWidth. Or, if totalWidth is less than the length of the specified string, a new String object that is identical to the specified string.
Remarks
A Unicode space is defined as hexadecimal 0x20.
The PadRight(const std::basic_string<char_t>&, int) method pads the end of the returned String. This means that, when used with right-to-left languages, it pads the left portion of the String..

§ remove() [1/2]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::remove ( const std::basic_string< char_t > &  str,
size_t  start_index 
)
inlinestaticnoexcept

Deletes all the characters from this String beginning at a specified position and continuing through the last position.

Parameters
start_indexThe position to begin deleting characters.
Returns
String A A new String object that is equivalent to this String less the removed characters.

§ remove() [2/2]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::remove ( const std::basic_string< char_t > &  str,
size_t  start_index,
size_t  count 
)
inlinestaticnoexcept

Deletes all the characters from this String beginning at a specified position and continuing through the last position.

Parameters
start_indexThe position to begin deleting characters.
countThe number of characters to delete.
Returns
String A A new String object that is equivalent to this String less the removed characters.

§ replace() [1/2]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::replace ( const std::basic_string< char_t > &  str,
char_t  old_char,
char_t  new_char 
)
inlinestaticnoexcept

Replaces all occurrences of a specified char_t in the specified string with another specified char_t.

Parameters
strString containing string to replace.
old_charA char_t to be replaced.
new_charA char_t to replace all occurrences of old_char.
Returns
String A A new String equivalent to the specified string but with all instances of old_char replaced with new_char.

§ replace() [2/2]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::replace ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  old_string,
const std::basic_string< char_t > &  new_string 
)
inlinestaticnoexcept

Replaces all occurrences of a specified String in the specified string with another specified String.

Parameters
strString containing string to replace.
old_stringA String to be replaced.
new_stringA String to replace all occurrences of old_string.
Returns
String A A new String equivalent to the specified string but with all instances of old_string replaced with new_string.
Remarks
If new_string is empty, all occurrences of old_string are removed

§ split() [1/5]

template<typename char_t >
static std::vector<std::basic_string<char_t> > xtd::strings::split ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  separators,
size_t  count,
string_split_options  options 
)
inlinestaticnoexcept

Splits a specified string into a maximum number of substrings based on the characters in an array.

Parameters
strstring to split.
separatorsA character array that delimits the substrings in this string, an empty array that contains no delimiters.
countThe maximum number of substrings to return.
optionsxtd::string_split_options::remove_empty_entries to omit empty array elements from the array returned; or None to include empty array elements in the array returned.
Returns
An array whose elements contain the substrings in this string that are delimited by one or more characters in separators. For more information, see the Remarks section.
Remarks
Delimiter characters are not included in the elements of the returned array.
If the specified string does not contain any of the characters in separator, or the count parameter is 1, the returned array consists of a single element that contains the specified string.
If the count parameter is zero, or the options parameter is remove_empty_entries and the length of the specified string is zero, an empty array is returned.
Each element of separator defines a separate delimiter character. If the options parameter is None, and two delimiters are adjacent or a delimiter is found at the beginning or end of the specified string, the corresponding array element contains an empty string.
If there are more than count substrings in the specified string, the first count minus 1 substrings are returned in the first count minus 1 elements of the return value, and the remaining characters in the specified string are returned in the last element of the return value.
If count is greater than the number of substrings, the available substrings are returned.

§ split() [2/5]

template<typename char_t >
static std::vector<std::basic_string<char_t> > xtd::strings::split ( const std::basic_string< char_t > &  str)
inlinestaticnoexcept

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.

Parameters
strstring to split.
Returns
An array whose elements contain the substrings in this string that are delimited by one or more characters in white-space separators. For more information, see the Remarks section.
Remarks
Delimiter characters are not included in the elements of the returned array.
If the specified string does not contain any of the characters in separator, or the count parameter is 1, the returned array consists of a single element that contains the specified string.

§ split() [3/5]

template<typename char_t >
static std::vector<std::basic_string<char_t> > xtd::strings::split ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  separators 
)
inlinestaticnoexcept

Splits a specified string into substrings that are based on the characters in an array.

Parameters
strstring to split.
separatorsA character array that delimits the substrings in this string, an empty array that contains no delimiters.
Returns
An array whose elements contain the substrings in this string that are delimited by one or more characters in separators. For more information, see the Remarks section.
Remarks
Delimiter characters are not included in the elements of the returned array.
If the specified string does not contain any of the characters in separator, or the count parameter is 1, the returned array consists of a single element that contains the specified string.

§ split() [4/5]

template<typename char_t >
static std::vector<std::basic_string<char_t> > xtd::strings::split ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  separators,
string_split_options  options 
)
inlinestaticnoexcept

Splits a specified string into substrings based on the characters in an array.

You can specify whether the substrings include empty array elements.

Parameters
strstring to split.
separatorsA character array that delimits the substrings in this string, an empty array that contains no delimiters.
optionsxtd::string_split_options::remove_empty_entries to omit empty array elements from the array returned; or None to include empty array elements in the array returned.
Returns
An array whose elements contain the substrings in this string that are delimited by one or more characters in separators. For more information, see the Remarks section.
Remarks
Delimiter characters are not included in the elements of the returned array.
If the specified string does not contain any of the characters in separator, or the count parameter is 1, the returned array consists of a single element that contains the specified string.
If the specified string does not contain any of the characters in separator, the returned array consists of a single element that contains the specified string.
If the options parameter is remove_empty_entries and the length of the specified string is zero, the method returns an empty array.
Each element of separator defines a separate delimiter that consists of a single character. If the options argument is none, and two delimiters are adjacent or a delimiter is found at the beginning or end of the specified string, the corresponding array element contains empty string. For example, if separator includes two elements, "-" and "_", the value of the string instance is "-_aa-_", and the value of the options argument is None, the method returns a string array with the following five elements:
  1. empty string, which represents the empty string that precedes the "-" character at index 0.
  2. empty string, which represents the empty string between the "-" character at index 0 and the "_" character at index 1.
  3. "aa",
  4. empty string, which represents the empty string that follows the "_" character at index 4.
  5. empty string, which represents the empty string that follows the "-" character at index 5.
If the separator parameter contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the c++ standard and return true if they are passed to the std::isspace() or std::iswspace() method.
If count is greater than the number of substrings, the available substrings are returned.

§ split() [5/5]

template<typename char_t >
static std::vector<std::basic_string<char_t> > xtd::strings::split ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  separators,
size_t  count 
)
inlinestaticnoexcept

Splits a specified string into a maximum number of substrings based on the characters in an array.

You also specify the maximum number of substrings to return.

Parameters
strstring to split.
separatorsA character array that delimits the substrings in this string, an empty array that contains no delimiters.
countThe maximum number of substrings to return.
Remarks
Delimiter characters are not included in the elements of the returned array.
If the specified string does not contain any of the characters in separator, or the count parameter is 1, the returned array consists of a single element that contains the specified string.
If the separator parameter contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and return true if they are passed to the char_t.IsWhiteSpace method.
Each element of separator defines a separate delimiter character. If two delimiters are adjacent, or a delimiter is found at the beginning or end of the specified string, the corresponding array element contains empty string.
If there are more than count substrings in the specified string, the first count minus 1 substrings are returned in the first count minus 1 elements of the return value, and the remaining characters in the specified string are returned in the last element of the return value.

§ starts_with() [1/4]

template<typename char_t >
static bool xtd::strings::starts_with ( const std::basic_string< char_t > &  str,
char_t  value 
)
inlinestaticnoexcept

Determines whether the beginning of an instance of String matches a specified String.

Parameters
strstring beginning with value.
valueA String to compare to.
Returns
bool true if value matches the beginning of the specified string; otherwise, false.
Remarks
This method compares value to the substring at the beginning of the specified string that is the same length as value, and returns an indication whether they are equal. To be equal, value must be a reference to this same instance, or match the beginning of the specified string.

§ starts_with() [2/4]

template<typename char_t >
static bool xtd::strings::starts_with ( const std::basic_string< char_t > &  str,
char_t  value,
bool  ignore_case 
)
inlinestaticnoexcept

Determines whether the beginning of an instance of String matches a specified String, ignoring or honoring their case.

Parameters
strstring beginning with value.
valueA String to compare to.
ignore_casetrue to ignore case when comparing the specified string and value; otherwise, false
Returns
bool true if value matches the beginning of the specified string; otherwise, false.
Remarks
This method compares value to the substring at the beginning of the specified string that is the same length as value, and returns an indication whether they are equal. To be equal, value must be a reference to this same instance, or match the beginning of the specified string.

§ starts_with() [3/4]

template<typename char_t >
static bool xtd::strings::starts_with ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value 
)
inlinestaticnoexcept

Determines whether the beginning of an instance of String matches a specified String.

Parameters
strstring beginning with value.
valueA String to compare to.
Returns
bool true if value matches the beginning of the specified string; otherwise, false.
Remarks
This method compares value to the substring at the beginning of the specified string that is the same length as value, and returns an indication whether they are equal. To be equal, value must be a reference to this same instance, or match the beginning of the specified string.

§ starts_with() [4/4]

template<typename char_t >
static bool xtd::strings::starts_with ( const std::basic_string< char_t > &  str,
const std::basic_string< char_t > &  value,
bool  ignore_case 
)
inlinestaticnoexcept

Determines whether the beginning of an instance of String matches a specified String, ignoring or honoring their case.

Parameters
strstring beginning with value.
valueA String to compare to.
ignore_casetrue to ignore case when comparing the specified string and value; otherwise, false
Returns
bool true if value matches the beginning of the specified string; otherwise, false.
Remarks
This method compares value to the substring at the beginning of the specified string that is the same length as value, and returns an indication whether they are equal. To be equal, value must be a reference to this same instance, or match the beginning of the specified string.

§ substring() [1/2]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::substring ( const std::basic_string< char_t > &  str,
size_t  start_index 
)
inlinestaticnoexcept

Retrieves a substring from this instance.

The substring starts at a specified character position and has a specified length.

Parameters
strstring to substring.
start_indexThe zero-based starting character position of a substring in this instance.
Returns
String A String equivalent to the substring of length length that begins at start_index in this instance, or Empty if start_index is equal to the length of this instance and length is zero.

§ substring() [2/2]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::substring ( const std::basic_string< char_t > &  str,
size_t  start_index,
size_t  length 
)
inlinestaticnoexcept

Retrieves a substring from this instance.

The substring starts at a specified character position and has a specified length.

Parameters
strstring to substring.
start_indexThe zero-based starting character position of a substring in this instance.
lengthThe number of characters in the substring.
Returns
String A String equivalent to the substring of length length that begins at start_index in this instance, or Empty if start_index is equal to the length of this instance and length is zero.

§ to_array() [1/3]

template<typename char_t >
static const std::vector<char_t> xtd::strings::to_array ( const std::basic_string< char_t > &  str)
inlinestaticnoexcept

Copies the characters in this instance to a Unicode character array.

Parameters
strstring to convert to array.
Returns
A character array whose elements are the individual characters of this instance. If this instance is an empty String, the returned array is empty and has a zero length.

§ to_array() [2/3]

template<typename char_t >
static const std::vector<char_t> xtd::strings::to_array ( const std::basic_string< char_t > &  str,
size_t  start_index 
)
inlinestaticnoexcept

Copies the characters in this instance to a Unicode character array starting at specitied index.

Parameters
strstring to convert to array.
start_indexThe starting position of string to convert.
Returns
A character array whose elements are the individual characters of this instance. If this instance is an empty String, the returned array is empty and has a zero length.

§ to_array() [3/3]

template<typename char_t >
static const std::vector<char_t> xtd::strings::to_array ( const std::basic_string< char_t > &  str,
size_t  start_index,
size_t  length 
)
inlinestaticnoexcept

Copies the characters in this instance to a Unicode character array starting at specitied index with specified legnth.

Parameters
strstring to convert to array.
start_indexThe starting position of string to convert.
lengthThe length of the string to convert
Returns
A character array whose elements are the individual characters of this instance. If this instance is an empty String, the returned array is empty and has a zero length.

§ to_lower()

template<typename char_t >
static const std::basic_string<char_t> xtd::strings::to_lower ( const std::basic_string< char_t > &  str)
inlinestaticnoexcept

Returns a copy of the specified string converted to lowercase.

Parameters
strstring to convert to lower.
Returns
String A new String in lowercase.

§ to_upper()

template<typename char_t >
static const std::basic_string<char_t> xtd::strings::to_upper ( const std::basic_string< char_t > &  str)
inlinestaticnoexcept

Returns a copy of the specified string converted to uppercase.

Parameters
strstring to convert to upper.
Returns
String A new String in uppercase.

§ trim() [1/3]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::trim ( const std::basic_string< char_t > &  str)
inlinestaticnoexcept

Removes all leading and trailing occurrences of white-space characters from the specifed String.

Parameters
strString to trim end.
trim_charA character to remove.
Returns
The String that remains after all occurrences of the character in the trim_char parameter are removed from the start and te and of the specified String.

§ trim() [2/3]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::trim ( const std::basic_string< char_t > &  str,
char_t  trim_char 
)
inlinestaticnoexcept

Removes all eading and trailing occurrences of a character specified from the specifed String .

Parameters
strString to trim start.
trim_charA character to remove.
Returns
The String that remains after all occurrences of the character in the trim_char parameter are removed from the start and the end of the specofoed String.

§ trim() [3/3]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::trim ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  trim_chars 
)
inlinestaticnoexcept

Removes all eading and trailing occurrences of a set of characters specified in an array from the specified String.

Parameters
strString to trim end.
trim_charsAn array of characters to remove.
Returns
The String that remains after all occurrences of the characters in the trim_chars parameter are removed from the start and the edn of the specified String.

§ trim_end() [1/3]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::trim_end ( const std::basic_string< char_t > &  str)
inlinestaticnoexcept

Removes all trailing occurrences of white-space characters from the specifed String.

Parameters
strString to trim end.
trim_charA character to remove.
Returns
The String that remains after all occurrences of the character in the trim_char parameter are removed from the end of the specified String.

§ trim_end() [2/3]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::trim_end ( const std::basic_string< char_t > &  str,
char_t  trim_char 
)
inlinestaticnoexcept

Removes all trailing occurrences of a character specified from the specifed String .

Parameters
strString to trim start.
trim_charA character to remove.
Returns
The String that remains after all occurrences of the character in the trim_char parameter are removed from the end of the specofoed String.

§ trim_end() [3/3]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::trim_end ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  trim_chars 
)
inlinestaticnoexcept

Removes all trailing occurrences of a set of characters specified in an array from the specified String.

Parameters
strString to trim end.
trim_charsAn array of characters to remove.
Returns
The String that remains after all occurrences of the characters in the trim_chars parameter are removed from the end of the specified String.

§ trim_start() [1/3]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::trim_start ( const std::basic_string< char_t > &  str)
inlinestaticnoexcept

Removes all leading occurrences of white-space characters from the specifed String.

Parameters
strString to trim start.
trim_charA character to remove.
Returns
The String that remains after all occurrences of the character in the trim_char parameter are removed from the start of the specified String.

§ trim_start() [2/3]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::trim_start ( const std::basic_string< char_t > &  str,
char_t  trim_char 
)
inlinestaticnoexcept

Removes all leading occurrences of a character specified from the specifed String .

Parameters
strString to trim start.
trim_charA character to remove.
Returns
The String that remains after all occurrences of the character in the trim_char parameter are removed from the start of the specofoed String.

§ trim_start() [3/3]

template<typename char_t >
static std::basic_string<char_t> xtd::strings::trim_start ( const std::basic_string< char_t > &  str,
const std::vector< char_t > &  trim_chars 
)
inlinestaticnoexcept

Removes all leading occurrences of a set of characters specified in an array from the specified String.

Parameters
strString to trim start.
trim_charsAn array of characters to remove.
Returns
The String that remains after all occurrences of the characters in the trim_chars parameter are removed from the start of the specified String.

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