xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Public Member Functions | Static Public Member Functions | List of all members
xtd::ustring Class Reference

#include <ustring.h>

Definition

Represents text as a sequence of UTF-8 code units.

Namespace
xtd
Library
xtd.core
Remarks
A string is a sequential collection of characters that's used to represent text. A xtd::ustring object is a sequential collection of xtd::char8 objects that represent a string; a xtd::char8 object corresponds to a UTF-8 code unit. The value of the xtd::utring object is the content of the sequential collection of xtd::char8 objects, and unlike std::basic_string that value is immutable (that is, it is read-only).
if you want the same mutable string class, you can use xtd::text::ustring_builder class.
xtd::ustring is inherited from std::basic_string<char> and therefore offers the full (immutable) API of std::string.
Examples:
folder_browser_dialog.cpp, input_box.cpp, and open_file_dialog.cpp.

Public Member Functions

 ustring () noexcept
 Initializes a new instance of xtd::ustring. More...
 
 ustring (const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::ustring with specitifed allocator. More...
 
 ustring (size_t count, value_type character)
 Initializes a new instance of xtd::ustring with specified count copies of character. More...
 
 ustring (size_t count, value_type character, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified count copies of character and specified allocator. More...
 
 ustring (size_t count, char8_t character)
 Initializes a new instance of xtd::ustring with specified count copies of character. More...
 
 ustring (size_t count, char8_t character, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified count copies of character and specified allocator. More...
 
 ustring (size_t count, char16_t character)
 Initializes a new instance of xtd::ustring with specified count copies of character. More...
 
 ustring (size_t count, char16_t character, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified count copies of character and specified allocator. More...
 
 ustring (size_t count, char32_t character)
 Initializes a new instance of xtd::ustring with specified count copies of character. More...
 
 ustring (size_t count, char32_t character, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified count copies of character and specified allocator. More...
 
 ustring (size_t count, wchar_t character)
 Initializes a new instance of xtd::ustring with specified count copies of character. More...
 
 ustring (size_t count, wchar_t character, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified count copies of character and specified allocator. More...
 
 ustring (const ustring &str, size_t index, size_t count)
 Initializes a new instance of xtd::ustring with specified substring at index and count characters. More...
 
 ustring (const ustring &str, size_t index, size_t count, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified substring at index, count characters and allocator. More...
 
 ustring (const ustring &str, size_t index)
 Initializes a new instance of xtd::ustring with specified substring at index. More...
 
 ustring (const ustring &str, size_t index, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified substring at index and allocator. More...
 
 ustring (const value_type *str, size_t count)
 Initializes a new instance of xtd::ustring with specified substring and count characters. More...
 
 ustring (const value_type *str, size_t count, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified substring, count characters and allocator. More...
 
 ustring (const value_type *str)
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (const value_type *str, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified string to copy, and allocator. More...
 
 ustring (value_type *str)
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (value_type *str, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified string to copy, and allocator. More...
 
 ustring (const ustring &str) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (const ustring &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy and allocator. More...
 
 ustring (const std::string &str) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (const std::string &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy and allocator. More...
 
 ustring (const std::u8string &str) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (const std::u8string &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy and allocator. More...
 
 ustring (const char8_t *str)
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (const char8_t *str, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified string to copy, and allocator. More...
 
 ustring (char8_t *str)
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (char8_t *str, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified string to copy, and allocator. More...
 
 ustring (const std::u16string &str) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (const std::u16string &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy and allocator. More...
 
 ustring (const char16_t *str)
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (const char16_t *str, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified string to copy, and allocator. More...
 
 ustring (char16_t *str)
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (char16_t *str, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified string to copy, and allocator. More...
 
 ustring (const std::u32string &str) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (const std::u32string &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy and allocator. More...
 
 ustring (const char32_t *str)
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (const char32_t *str, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified string to copy, and allocator. More...
 
 ustring (char32_t *str)
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (char32_t *str, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified string to copy, and allocator. More...
 
 ustring (const std::wstring &str) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (const std::wstring &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::ustring with specified string to copy and allocator. More...
 
 ustring (const wchar_t *str)
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (const wchar_t *str, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified string to copy, and allocator. More...
 
 ustring (wchar_t *str)
 Initializes a new instance of xtd::ustring with specified string to copy. More...
 
 ustring (wchar_t *str, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified string to copy, and allocator. More...
 
 ustring (ustring &&str) noexcept
 Initializes a new instance of xtd::ustring with specified string to move. More...
 
 ustring (ustring &&str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::ustring with specified string to move and allocator. More...
 
template<typename input_iterator_t >
 ustring (input_iterator_t first, input_iterator_t last)
 Initializes a new instance of xtd::ustring with specified first and last iterators of substring. More...
 
template<typename input_iterator_t >
 ustring (input_iterator_t first, input_iterator_t last, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified first and last iterators of substring and allocator. More...
 
 ustring (std::initializer_list< value_type > il)
 Initializes a new instance of xtd::ustring with specified initializer list. More...
 
 ustring (std::initializer_list< value_type > il, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified initializer list and allocator. More...
 
 ustring (std::initializer_list< char8_t > il)
 Initializes a new instance of xtd::ustring with specified initializer list. More...
 
 ustring (std::initializer_list< char8_t > il, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified initializer list and allocator. More...
 
 ustring (std::initializer_list< char16_t > il)
 Initializes a new instance of xtd::ustring with specified initializer list. More...
 
 ustring (std::initializer_list< char16_t > il, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified initializer list and allocator. More...
 
 ustring (std::initializer_list< char32_t > il)
 Initializes a new instance of xtd::ustring with specified initializer list. More...
 
 ustring (std::initializer_list< char32_t > il, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified initializer list and allocator. More...
 
 ustring (std::initializer_list< wchar_t > il)
 Initializes a new instance of xtd::ustring with specified initializer list. More...
 
 ustring (std::initializer_list< wchar_t > il, const allocator_type &allocator)
 Initializes a new instance of xtd::ustring with specified initializer list and allocator. More...
 
bool contains (const ustring &value) const noexcept
 Returns a value indicating whether a specified substring occurs within this string. More...
 
bool ends_with (value_type value) const noexcept
 Determines whether the end of this string matches the specified character. More...
 
bool ends_with (char8_t value) const noexcept
 Determines whether the end of this string matches the specified character. More...
 
bool ends_with (const ustring &value) const noexcept
 Determines whether the end of this string matches the specified string. More...
 
bool ends_with (const ustring &value, bool ignore_case) const noexcept
 Determines whether the end of this string instance matches the specified string when compared using the specified culture. More...
 
bool ends_with (const ustring &value, xtd::string_comparison comparison_type) const noexcept
 Determines whether the end of this string matches the specified string when compared using the specified comparison option. More...
 
size_t get_hash_code () const noexcept override
 Returns the hash code for this string. More...
 
size_t index_of (value_type value) const noexcept
 Reports the index of the first occurrence of the specified character in this string. More...
 
size_t index_of (const ustring &value) const noexcept
 Reports the index of the first occurrence of the specified string in this string. More...
 
size_t index_of (value_type value, size_t start_index) const noexcept
 Reports the index of the first occurrence of the specified character in this string. The search starts at a specified character position. More...
 
size_t index_of (const ustring &value, size_t start_index) const noexcept
 Reports the index of the first occurrence of the specified character in this string. The search starts at a specified character position. More...
 
size_t index_of (value_type value, size_t start_index, size_t count) const noexcept
 Reports the index of the first occurrence of the specified character in this string. The search starts at a specified character position and examines a specified number of character positions. More...
 
size_t index_of (const ustring &value, size_t start_index, size_t count) const noexcept
 Reports the index of the first occurrence of the specified character in this string. The search starts at a specified character position and examines a specified number of character positions. More...
 
size_t index_of_any (const std::vector< value_type > &values) const noexcept
 Reports the index of the first occurrence in this instance of any character in a specified array of characters. More...
 
size_t index_of_any (const std::vector< value_type > &values, size_t start_index) const 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...
 
size_t index_of_any (const std::vector< value_type > &values, size_t start_index, size_t count) const 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...
 
ustring insert (size_t start_index, const ustring &value) const noexcept
 Inserts a specified instance of string at a specified index position in this instance. More...
 
bool is_empty () const noexcept
 Indicates whether this string is an empty string (""). More...
 
size_t last_index_of (value_type value) const noexcept
 Reports the index of the last occurrence of the specified character in this tring. More...
 
size_t last_index_of (const ustring &value) const noexcept
 Reports the index of the last occurrence of the specified string in this string. More...
 
size_t last_index_of (value_type value, size_t start_index) const noexcept
 Reports the index of the last occurrence of the specified character in this string. The search starts at a specified character position. More...
 
size_t last_index_of (const ustring &value, size_t start_index) const noexcept
 Reports the index of the last occurrence of the specified character in this string. The search starts at a specified character position. More...
 
size_t last_index_of (value_type value, size_t start_index, size_t count) const noexcept
 Reports the index of the last occurrence of the specified character in this string. The search starts at a specified character position and examines a specified number of character positions. More...
 
size_t last_index_of (const ustring &value, size_t start_index, size_t count) const noexcept
 Reports the index of the last occurrence of the specified character in this string. The search starts at a specified character position and examines a specified number of character positions. More...
 
size_t last_index_of_any (const std::vector< value_type > &values) const noexcept
 Reports the index of the last occurrence in this instance of any character in a specified array of characters. More...
 
size_t last_index_of_any (const std::vector< value_type > &values, size_t start_index) const 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...
 
size_t last_index_of_any (const std::vector< value_type > &values, size_t start_index, size_t count) const 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...
 
ustring pad_left (size_t total_width) const noexcept
 Right-aligns the characters in this string, padding with spaces on the left for a specified total length. More...
 
ustring pad_left (size_t total_width, value_type padding_char) const noexcept
 Right-aligns the characters in this string, padding with spaces on the left for a specified total length. More...
 
ustring pad_right (size_t total_width) const noexcept
 Left-aligns the characters in this string, padding with spaces on the right for a specified total length. More...
 
ustring pad_right (size_t total_width, value_type padding_char) const noexcept
 Left-aligns the characters in this string, padding with spaces on the right for a specified total length. More...
 
ustring remove (size_t start_index) const noexcept
 Deletes all the characters from this string beginning at a specified position and continuing through the last position. More...
 
ustring remove (size_t start_index, size_t count) const noexcept
 Deletes all the characters from this string beginning at a specified position and continuing through the last position. More...
 
ustring replace (value_type old_char, value_type new_char) const noexcept
 Replaces all occurrences of a specified char_t in this string with another specified char_t. More...
 
ustring replace (const ustring &old_string, const ustring &new_string) const noexcept
 Replaces all occurrences of a specified string in this string with another specified string. More...
 
std::vector< ustringsplit (const std::vector< value_type > &separators, size_t count, string_split_options options) const noexcept
 Splits this string into a maximum number of substrings based on the characters in an array. More...
 
std::vector< ustringsplit () const noexcept
 Splits this 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...
 
std::vector< ustringsplit (const std::vector< value_type > &separators) const noexcept
 Splits this string into substrings that are based on the characters in an array. More...
 
std::vector< ustringsplit (const std::vector< value_type > &separators, string_split_options options) const noexcept
 Splits this string into substrings based on the characters in an array. You can specify whether the substrings include empty array elements. More...
 
std::vector< ustringsplit (const std::vector< value_type > &separators, size_t count) const noexcept
 Splits this string into a maximum number of substrings based on the characters in an array. You also specify the maximum number of substrings to return. More...
 
bool starts_with (value_type value) const noexcept
 Determines whether the beginning of this instance of String matches a specified String. More...
 
bool starts_with (value_type value, bool ignore_case) const noexcept
 Determines whether the beginning of this instance of String matches a specified String, ignoring or honoring their case. More...
 
bool starts_with (const ustring &value) const noexcept
 Determines whether the beginning of this instance of String matches a specified String. More...
 
bool starts_with (const ustring &value, bool ignore_case) const noexcept
 Determines whether the beginning of this instance of String matches a specified String, ignoring or honoring their case. More...
 
ustring substring (size_t start_index) const noexcept
 Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length. More...
 
ustring substring (size_t start_index, size_t length) const noexcept
 Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length. More...
 
std::vector< value_type > to_array () const noexcept
 Copies the characters in this instance to a Unicode character array. More...
 
std::vector< value_type > to_array (size_t start_index) const noexcept
 Copies the characters in this instance to a Unicode character array starting at specitied index. More...
 
std::vector< value_type > to_array (size_t start_index, size_t length) const noexcept
 Copies the characters in this instance to a Unicode character array starting at specitied index with specified legnth. More...
 
ustring to_lower () const noexcept
 Returns a copy of the current string converted to lowercase. More...
 
ustring to_string () const noexcept override
 Returns a std::string that represents the current object. More...
 
ustring to_upper () const noexcept
 Returns a copy of the current string converted to uppercase. More...
 
ustring trim () const noexcept
 Removes all leading and trailing occurrences of white-space characters from the specifed String. More...
 
ustring trim (value_type trim_char) const noexcept
 Removes all eading and trailing occurrences of a character specified from the specifed String . More...
 
ustring trim (const std::vector< value_type > &trim_chars) const noexcept
 Removes all eading and trailing occurrences of a set of characters specified in an array from the specified String. More...
 
ustring trim_end () const noexcept
 Removes all trailing occurrences of white-space characters from the specifed String. More...
 
ustring trim_end (value_type trim_char) const noexcept
 Removes all trailing occurrences of a character specified from the specifed String . More...
 
ustring trim_end (const std::vector< value_type > &trim_chars) const noexcept
 Removes all trailing occurrences of a set of characters specified in an array from the specified String. More...
 
ustring trim_start () const noexcept
 Removes all leading occurrences of white-space characters from the specifed String. More...
 
ustring trim_start (value_type trim_char) const noexcept
 Removes all leading occurrences of a character specified from the specifed String . More...
 
ustring trim_start (const std::vector< value_type > &trim_chars) const noexcept
 Removes all leading occurrences of a set of characters specified in an array from the specified String. More...
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const
 Gets the type of the current instance. More...
 

Static Public Member Functions

template<typename object_t >
static ustring class_name ()
 Gets the class name of the object_t. More...
 
template<typename object_t >
static ustring class_name (const object_t &object)
 Gets the class name of the specified object. More...
 
static ustring class_name (const std::type_info &info)
 Gets the class name of the specified object. More...
 
static int compare (const ustring &str_a, const ustring &str_b) noexcept
 Compares two specified string objects and returns an integer that indicates their relative position in the sort order. More...
 
static int compare (const ustring &str_a, const ustring &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...
 
static int compare (const ustring &str_a, const ustring &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...
 
static int compare (const ustring &str_a, size_t index_a, const ustring &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...
 
static int compare (const ustring &str_a, size_t index_a, const ustring &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...
 
static int compare (const ustring &str_a, size_t index_a, const ustring &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...
 
static ustring concat (const ustring &str_a, const ustring &str_b, const ustring &str_c, const ustring &str_d) noexcept
 Concatenates four specified instances of string. More...
 
template<typename object_a_t , typename object_b_t , typename object_c_t , typename object_d_t >
static ustring concat (object_a_t obj_a, object_b_t obj_b, object_c_t obj_c, object_d_t obj_d) noexcept
 Concatenates four specified instances of object. More...
 
static ustring concat (const ustring &str_a, const ustring &str_b, const ustring &str_c) noexcept
 Concatenates three specified instances of string. More...
 
template<typename object_a_t , typename object_b_t , typename object_c_t >
static ustring concat (object_a_t obj_a, object_b_t obj_b, object_c_t obj_c) noexcept
 Concatenates three specified instances of object. More...
 
static ustring concat (const ustring &str_a, const ustring &str_b) noexcept
 Concatenates two specified instances of string. More...
 
template<typename object_a_t , typename object_b_t >
static ustring concat (object_a_t obj_a, object_b_t obj_b) noexcept
 Concatenates two specified instances of object. More...
 
static ustring concat (const std::vector< ustring > &values) noexcept
 Concatenates the elements of a specified string array. More...
 
template<typename object_t >
static ustring concat (const std::vector< object_t > &args) noexcept
 Concatenates the string representations of the elements in a specified object array. More...
 
template<typename value_t >
static ustring concat (value_t value) noexcept
 Creates the string representation of a specified object. More...
 
static ustring demangle (const ustring &name)
 Gets demangled string of name,. More...
 
static ustring empty_string () noexcept
 Represents the empty string. More...
 
template<typename ... args_t>
static ustring format (const ustring &fmt, args_t &&... args)
 Writes the text representation of the specified arguments list, to string using the specified format information. More...
 
template<typename object_t >
static ustring 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 ustring 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 ustring full_class_name (const std::type_info &info)
 Gets the fully qualified class name of the specified object, including the namespace of the specified object. More...
 
template<typename collection_t >
static ustring join (const ustring separator, const collection_t &values) noexcept
 Concatenates a specified separator string between each element of a specified object array, yielding a single concatenated string. More...
 
template<typename collection_t >
static ustring join (const ustring &separator, const collection_t &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 collection_t >
static ustring join (const ustring &separator, const collection_t &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 value_t >
static value_t parse (const ustring &str)
 
template<typename ... args_t>
static ustring sprintf (const ustring &fmt, args_t &&... args) noexcept
 Writes the text representation of the specified arguments list, to string using the specified format information. More...
 
template<typename value_t >
static bool try_parse (const ustring &str, value_t &value)
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

Constructor & Destructor Documentation

◆ ustring() [1/64]

xtd::ustring::ustring ( )
noexcept

Initializes a new instance of xtd::ustring.

◆ ustring() [2/64]

xtd::ustring::ustring ( const allocator_type &  allocator)
explicitnoexcept

Initializes a new instance of xtd::ustring with specitifed allocator.

Parameters
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [3/64]

xtd::ustring::ustring ( size_t  count,
value_type  character 
)

Initializes a new instance of xtd::ustring with specified count copies of character.

Parameters
strThe string to copy.
countThe number of copies of character.
characterThe character copied.

◆ ustring() [4/64]

xtd::ustring::ustring ( size_t  count,
value_type  character,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified count copies of character and specified allocator.

Parameters
strThe string to copy.
countThe number of copies of character.
characterThe character copied.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [5/64]

xtd::ustring::ustring ( size_t  count,
char8_t  character 
)

Initializes a new instance of xtd::ustring with specified count copies of character.

Parameters
strThe string to copy.
countThe number of copies of character.
characterThe character copied.

◆ ustring() [6/64]

xtd::ustring::ustring ( size_t  count,
char8_t  character,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified count copies of character and specified allocator.

Parameters
strThe string to copy.
countThe number of copies of character.
characterThe character copied.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [7/64]

xtd::ustring::ustring ( size_t  count,
char16_t  character 
)

Initializes a new instance of xtd::ustring with specified count copies of character.

Parameters
strThe string to copy.
countThe number of copies of character.
characterThe character copied.

◆ ustring() [8/64]

xtd::ustring::ustring ( size_t  count,
char16_t  character,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified count copies of character and specified allocator.

Parameters
strThe string to copy.
countThe number of copies of character.
characterThe character copied.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [9/64]

xtd::ustring::ustring ( size_t  count,
char32_t  character 
)

Initializes a new instance of xtd::ustring with specified count copies of character.

Parameters
strThe string to copy.
countThe number of copies of character.
characterThe character copied.

◆ ustring() [10/64]

xtd::ustring::ustring ( size_t  count,
char32_t  character,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified count copies of character and specified allocator.

Parameters
strThe string to copy.
countThe number of copies of character.
characterThe character copied.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [11/64]

xtd::ustring::ustring ( size_t  count,
wchar_t  character 
)

Initializes a new instance of xtd::ustring with specified count copies of character.

Parameters
strThe string to copy.
countThe number of copies of character.
characterThe character copied.

◆ ustring() [12/64]

xtd::ustring::ustring ( size_t  count,
wchar_t  character,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified count copies of character and specified allocator.

Parameters
strThe string to copy.
countThe number of copies of character.
characterThe character copied.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [13/64]

xtd::ustring::ustring ( const ustring str,
size_t  index,
size_t  count 
)

Initializes a new instance of xtd::ustring with specified substring at index and count characters.

Parameters
strThe string to copy.
indexThe index of the first substring charecter where start copy.
countThe number of substring characters to copy.

◆ ustring() [14/64]

xtd::ustring::ustring ( const ustring str,
size_t  index,
size_t  count,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified substring at index, count characters and allocator.

Parameters
strThe string to copy.
indexThe index of the first substring charecter where start copy.
countThe number of substring characters to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [15/64]

xtd::ustring::ustring ( const ustring str,
size_t  index 
)

Initializes a new instance of xtd::ustring with specified substring at index.

Parameters
strThe string to copy.
indexThe index of the first substring charecter where start copy.

◆ ustring() [16/64]

xtd::ustring::ustring ( const ustring str,
size_t  index,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified substring at index and allocator.

Parameters
strThe string to copy.
indexThe index of the first substring charecter where start copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [17/64]

xtd::ustring::ustring ( const value_type *  str,
size_t  count 
)

Initializes a new instance of xtd::ustring with specified substring and count characters.

Parameters
countThe number of substring characters to copy.

◆ ustring() [18/64]

xtd::ustring::ustring ( const value_type *  str,
size_t  count,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified substring, count characters and allocator.

Parameters
strThe string to copy.
countThe number of substring characters to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [19/64]

xtd::ustring::ustring ( const value_type *  str)

Initializes a new instance of xtd::ustring with specified string to copy.

◆ ustring() [20/64]

xtd::ustring::ustring ( const value_type *  str,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified string to copy, and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [21/64]

xtd::ustring::ustring ( value_type *  str)

Initializes a new instance of xtd::ustring with specified string to copy.

◆ ustring() [22/64]

xtd::ustring::ustring ( value_type *  str,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified string to copy, and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [23/64]

xtd::ustring::ustring ( const ustring str)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy.

Parameters
strThe string to copy.

◆ ustring() [24/64]

xtd::ustring::ustring ( const ustring str,
const allocator_type &  allocator 
)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [25/64]

xtd::ustring::ustring ( const std::string &  str)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy.

Parameters
strThe string to copy.

◆ ustring() [26/64]

xtd::ustring::ustring ( const std::string &  str,
const allocator_type &  allocator 
)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [27/64]

xtd::ustring::ustring ( const std::u8string &  str)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy.

Parameters
strThe string to copy.

◆ ustring() [28/64]

xtd::ustring::ustring ( const std::u8string &  str,
const allocator_type &  allocator 
)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [29/64]

xtd::ustring::ustring ( const char8_t *  str)

Initializes a new instance of xtd::ustring with specified string to copy.

◆ ustring() [30/64]

xtd::ustring::ustring ( const char8_t *  str,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified string to copy, and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [31/64]

xtd::ustring::ustring ( char8_t *  str)

Initializes a new instance of xtd::ustring with specified string to copy.

◆ ustring() [32/64]

xtd::ustring::ustring ( char8_t *  str,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified string to copy, and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [33/64]

xtd::ustring::ustring ( const std::u16string &  str)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy.

Parameters
strThe string to copy.

◆ ustring() [34/64]

xtd::ustring::ustring ( const std::u16string &  str,
const allocator_type &  allocator 
)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [35/64]

xtd::ustring::ustring ( const char16_t *  str)

Initializes a new instance of xtd::ustring with specified string to copy.

◆ ustring() [36/64]

xtd::ustring::ustring ( const char16_t *  str,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified string to copy, and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [37/64]

xtd::ustring::ustring ( char16_t *  str)

Initializes a new instance of xtd::ustring with specified string to copy.

◆ ustring() [38/64]

xtd::ustring::ustring ( char16_t *  str,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified string to copy, and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [39/64]

xtd::ustring::ustring ( const std::u32string &  str)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy.

Parameters
strThe string to copy.

◆ ustring() [40/64]

xtd::ustring::ustring ( const std::u32string &  str,
const allocator_type &  allocator 
)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [41/64]

xtd::ustring::ustring ( const char32_t *  str)

Initializes a new instance of xtd::ustring with specified string to copy.

◆ ustring() [42/64]

xtd::ustring::ustring ( const char32_t *  str,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified string to copy, and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [43/64]

xtd::ustring::ustring ( char32_t *  str)

Initializes a new instance of xtd::ustring with specified string to copy.

◆ ustring() [44/64]

xtd::ustring::ustring ( char32_t *  str,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified string to copy, and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [45/64]

xtd::ustring::ustring ( const std::wstring &  str)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy.

Parameters
strThe string to copy.

◆ ustring() [46/64]

xtd::ustring::ustring ( const std::wstring &  str,
const allocator_type &  allocator 
)
noexcept

Initializes a new instance of xtd::ustring with specified string to copy and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [47/64]

xtd::ustring::ustring ( const wchar_t *  str)

Initializes a new instance of xtd::ustring with specified string to copy.

◆ ustring() [48/64]

xtd::ustring::ustring ( const wchar_t *  str,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified string to copy, and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [49/64]

xtd::ustring::ustring ( wchar_t *  str)

Initializes a new instance of xtd::ustring with specified string to copy.

◆ ustring() [50/64]

xtd::ustring::ustring ( wchar_t *  str,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified string to copy, and allocator.

Parameters
strThe string to copy.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [51/64]

xtd::ustring::ustring ( ustring &&  str)
noexcept

Initializes a new instance of xtd::ustring with specified string to move.

Parameters
strThe string to move.

◆ ustring() [52/64]

xtd::ustring::ustring ( ustring &&  str,
const allocator_type &  allocator 
)
noexcept

Initializes a new instance of xtd::ustring with specified string to move and allocator.

Parameters
strThe string to move.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [53/64]

template<typename input_iterator_t >
xtd::ustring::ustring ( input_iterator_t  first,
input_iterator_t  last 
)
inline

Initializes a new instance of xtd::ustring with specified first and last iterators of substring.

Parameters
firstThe first iterator of substring.
lastThe first iterator of substring.

◆ ustring() [54/64]

template<typename input_iterator_t >
xtd::ustring::ustring ( input_iterator_t  first,
input_iterator_t  last,
const allocator_type &  allocator 
)
inline

Initializes a new instance of xtd::ustring with specified first and last iterators of substring and allocator.

Parameters
firstThe first iterator of substring.
lastThe first iterator of substring.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [55/64]

xtd::ustring::ustring ( std::initializer_list< value_type >  il)

Initializes a new instance of xtd::ustring with specified initializer list.

Parameters
ilThe initalizer list to fill.

◆ ustring() [56/64]

xtd::ustring::ustring ( std::initializer_list< value_type >  il,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified initializer list and allocator.

Parameters
ilThe initalizer list to fill.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [57/64]

xtd::ustring::ustring ( std::initializer_list< char8_t >  il)

Initializes a new instance of xtd::ustring with specified initializer list.

Parameters
ilThe initalizer list to fill.

◆ ustring() [58/64]

xtd::ustring::ustring ( std::initializer_list< char8_t >  il,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified initializer list and allocator.

Parameters
ilThe initalizer list to fill.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [59/64]

xtd::ustring::ustring ( std::initializer_list< char16_t >  il)

Initializes a new instance of xtd::ustring with specified initializer list.

Parameters
ilThe initalizer list to fill.

◆ ustring() [60/64]

xtd::ustring::ustring ( std::initializer_list< char16_t >  il,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified initializer list and allocator.

Parameters
ilThe initalizer list to fill.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [61/64]

xtd::ustring::ustring ( std::initializer_list< char32_t >  il)

Initializes a new instance of xtd::ustring with specified initializer list.

Parameters
ilThe initalizer list to fill.

◆ ustring() [62/64]

xtd::ustring::ustring ( std::initializer_list< char32_t >  il,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified initializer list and allocator.

Parameters
ilThe initalizer list to fill.
allocatorThe allocator to use for all memory allocations of this string.

◆ ustring() [63/64]

xtd::ustring::ustring ( std::initializer_list< wchar_t >  il)

Initializes a new instance of xtd::ustring with specified initializer list.

Parameters
ilThe initalizer list to fill.

◆ ustring() [64/64]

xtd::ustring::ustring ( std::initializer_list< wchar_t >  il,
const allocator_type &  allocator 
)

Initializes a new instance of xtd::ustring with specified initializer list and allocator.

Parameters
ilThe initalizer list to fill.
allocatorThe allocator to use for all memory allocations of this string.

Member Function Documentation

◆ class_name() [1/3]

template<typename object_t >
static ustring xtd::ustring::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 ustring type is ustring.

◆ class_name() [2/3]

template<typename object_t >
static ustring xtd::ustring::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 ustring type is ustring.

◆ class_name() [3/3]

static ustring xtd::ustring::class_name ( const std::type_info &  info)
inlinestatic

Gets the class name of the specified object.

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

◆ compare() [1/6]

static int xtd::ustring::compare ( const ustring str_a,
const ustring str_b 
)
staticnoexcept

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]

static int xtd::ustring::compare ( const ustring str_a,
const ustring str_b,
bool  ignore_case 
)
staticnoexcept

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]

static int xtd::ustring::compare ( const ustring str_a,
const ustring str_b,
xtd::string_comparison  comparison_type 
)
staticnoexcept

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]

static int xtd::ustring::compare ( const ustring str_a,
size_t  index_a,
const ustring str_b,
size_t  index_b,
size_t  length 
)
staticnoexcept

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]

static int xtd::ustring::compare ( const ustring str_a,
size_t  index_a,
const ustring str_b,
size_t  index_b,
size_t  length,
bool  ignore_case 
)
staticnoexcept

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]

static int xtd::ustring::compare ( const ustring str_a,
size_t  index_a,
const ustring str_b,
size_t  index_b,
size_t  length,
xtd::string_comparison  comparison_type 
)
staticnoexcept

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/9]

static ustring xtd::ustring::concat ( const ustring str_a,
const ustring str_b,
const ustring str_c,
const ustring str_d 
)
staticnoexcept

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/9]

template<typename object_a_t , typename object_b_t , typename object_c_t , typename object_d_t >
static ustring xtd::ustring::concat ( object_a_t  obj_a,
object_b_t  obj_b,
object_c_t  obj_c,
object_d_t  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/9]

static ustring xtd::ustring::concat ( const ustring str_a,
const ustring str_b,
const ustring str_c 
)
staticnoexcept

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() [4/9]

template<typename object_a_t , typename object_b_t , typename object_c_t >
static ustring xtd::ustring::concat ( object_a_t  obj_a,
object_b_t  obj_b,
object_c_t  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() [5/9]

static ustring xtd::ustring::concat ( const ustring str_a,
const ustring str_b 
)
staticnoexcept

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() [6/9]

template<typename object_a_t , typename object_b_t >
static ustring xtd::ustring::concat ( object_a_t  obj_a,
object_b_t  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() [7/9]

static ustring xtd::ustring::concat ( const std::vector< ustring > &  values)
staticnoexcept

Concatenates the elements of a specified string array.

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

◆ concat() [8/9]

template<typename object_t >
static ustring xtd::ustring::concat ( const std::vector< object_t > &  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() [9/9]

template<typename value_t >
static ustring xtd::ustring::concat ( value_t  value)
inlinestaticnoexcept

Creates the string representation of a specified object.

Parameters
valueThe object to represent.
Returns
The string representation of the value of arg.

◆ contains()

bool xtd::ustring::contains ( const ustring value) const
noexcept

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

Parameters
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 ustring xtd::ustring::demangle ( const ustring name)
inlinestatic

Gets demangled string of name,.

Returns
The demangled string of name.

◆ empty_string()

static ustring xtd::ustring::empty_string ( )
staticnoexcept

Represents the empty string.

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

◆ ends_with() [1/5]

bool xtd::ustring::ends_with ( value_type  value) const
noexcept

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

Parameters
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/5]

bool xtd::ustring::ends_with ( char8_t  value) const
noexcept

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

Parameters
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() [3/5]

bool xtd::ustring::ends_with ( const ustring value) const
noexcept

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

Parameters
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() [4/5]

bool xtd::ustring::ends_with ( const ustring value,
bool  ignore_case 
) const
noexcept

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

Parameters
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() [5/5]

bool xtd::ustring::ends_with ( const ustring value,
xtd::string_comparison  comparison_type 
) const
noexcept

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

Parameters
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.

◆ full_class_name() [1/3]

template<typename object_t >
static ustring xtd::ustring::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 ustring type is xtd::ustring.

◆ full_class_name() [2/3]

template<typename object_t >
static ustring xtd::ustring::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 ustring type is xtd::ustring.

◆ full_class_name() [3/3]

static ustring xtd::ustring::full_class_name ( const std::type_info &  info)
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 ustring type is xtd::ustring.

◆ get_hash_code()

size_t xtd::ustring::get_hash_code ( ) const
overridevirtualnoexcept

Returns the hash code for this string.

Returns
A hash code.

Reimplemented from xtd::object.

◆ index_of() [1/6]

size_t xtd::ustring::index_of ( value_type  value) const
noexcept

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

Parameters
valueAn unicode character to seek
Returns
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]

size_t xtd::ustring::index_of ( const ustring value) const
noexcept

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

Parameters
valueAn unicode character to seek
Returns
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]

size_t xtd::ustring::index_of ( value_type  value,
size_t  start_index 
) const
noexcept

Reports the index of the first occurrence of the specified character in this string. The search starts at a specified character position.

Parameters
valueAn unicode character to seek
start_indexThe search starting position
Returns
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]

size_t xtd::ustring::index_of ( const ustring value,
size_t  start_index 
) const
noexcept

Reports the index of the first occurrence of the specified character in this string. The search starts at a specified character position.

Parameters
valueAn unicode character to seek
start_indexThe search starting position
Returns
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]

size_t xtd::ustring::index_of ( value_type  value,
size_t  start_index,
size_t  count 
) const
noexcept

Reports the index of the first occurrence of the specified character in this string. The search starts at a specified character position and examines a specified number of character positions.

Parameters
valueAn unicode character to seek
start_indexThe search starting position
countThe number of character positions to examine
Returns
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]

size_t xtd::ustring::index_of ( const ustring value,
size_t  start_index,
size_t  count 
) const
noexcept

Reports the index of the first occurrence of the specified character in this string. The search starts at a specified character position and examines a specified number of character positions.

Parameters
valueAn unicode character to seek
start_indexThe search starting position
countThe number of character positions to examine
Returns
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]

size_t xtd::ustring::index_of_any ( const std::vector< value_type > &  values) const
noexcept

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

Parameters
valuesAn unicode character array containing one or more characters to seek
Returns
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]

size_t xtd::ustring::index_of_any ( const std::vector< value_type > &  values,
size_t  start_index 
) const
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.

Parameters
valuesAn unicode character array containing one or more characters to seek
start_indexThe search starting position
Returns
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]

size_t xtd::ustring::index_of_any ( const std::vector< value_type > &  values,
size_t  start_index,
size_t  count 
) const
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.

Parameters
valuesAn unicode character array containing one or more characters to seek
start_indexThe search starting position
countThe number of character positions to examine.
Returns
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()

ustring xtd::ustring::insert ( size_t  start_index,
const ustring value 
) const
noexcept

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
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()

bool xtd::ustring::is_empty ( ) const
noexcept

Indicates whether this string is an empty string ("").

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

◆ join() [1/3]

template<typename collection_t >
static ustring xtd::ustring::join ( const ustring  separator,
const collection_t &  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 collection_t >
static ustring xtd::ustring::join ( const ustring separator,
const collection_t &  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 collection_t >
static ustring xtd::ustring::join ( const ustring separator,
const collection_t &  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]

size_t xtd::ustring::last_index_of ( value_type  value) const
noexcept

Reports the index of the last occurrence of the specified character in this tring.

Parameters
valueAn unicode character to seek
Returns
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]

size_t xtd::ustring::last_index_of ( const ustring value) const
noexcept

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

Parameters
valueAn unicode character to seek
Returns
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]

size_t xtd::ustring::last_index_of ( value_type  value,
size_t  start_index 
) const
noexcept

Reports the index of the last occurrence of the specified character in this string. The search starts at a specified character position.

Parameters
valueAn unicode character to seek
start_indexThe search starting position
Returns
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]

size_t xtd::ustring::last_index_of ( const ustring value,
size_t  start_index 
) const
noexcept

Reports the index of the last occurrence of the specified character in this string. The search starts at a specified character position.

Parameters
valueAn unicode character to seek
start_indexThe search starting position
Returns
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]

size_t xtd::ustring::last_index_of ( value_type  value,
size_t  start_index,
size_t  count 
) const
noexcept

Reports the index of the last occurrence of the specified character in this 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.
valueAn unicode character to seek
start_indexThe search starting position
countThe number of character positions to examine
Returns
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]

size_t xtd::ustring::last_index_of ( const ustring value,
size_t  start_index,
size_t  count 
) const
noexcept

Reports the index of the last occurrence of the specified character in this string. The search starts at a specified character position and examines a specified number of character positions.

Parameters
valueAn unicode character to seek
start_indexThe search starting position
countThe number of character positions to examine
Returns
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]

size_t xtd::ustring::last_index_of_any ( const std::vector< value_type > &  values) const
noexcept

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

Parameters
valuesAn unicode character array containing one or more characters to seek
Returns
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]

size_t xtd::ustring::last_index_of_any ( const std::vector< value_type > &  values,
size_t  start_index 
) const
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.

Parameters
valuesAn unicode character array containing one or more characters to seek
start_indexThe search starting position
Returns
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]

size_t xtd::ustring::last_index_of_any ( const std::vector< value_type > &  values,
size_t  start_index,
size_t  count 
) const
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.

Parameters
valuesAn unicode character array containing one or more characters to seek
start_indexThe search starting position
countThe number of character positions to examine.
Returns
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]

ustring xtd::ustring::pad_left ( size_t  total_width) const
noexcept

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

Parameters
total_widthThe number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.
Returns
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
An 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]

ustring xtd::ustring::pad_left ( size_t  total_width,
value_type  padding_char 
) const
noexcept

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

Parameters
total_widthThe number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.
paddingCharAn unicode padding character.
Returns
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
An 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]

ustring xtd::ustring::pad_right ( size_t  total_width) const
noexcept

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

Parameters
totalWidthThe number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.
Returns
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
An 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]

ustring xtd::ustring::pad_right ( size_t  total_width,
value_type  padding_char 
) const
noexcept

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

Parameters
totalWidthThe number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.
paddingCharAn unicode padding character.
Returns
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
An unicode space is defined as hexadecimal 0x20.
The xtd::ustring::pad_right 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]

ustring xtd::ustring::remove ( size_t  start_index) const
noexcept

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
A new string object that is equivalent to this string less the removed characters.

◆ remove() [2/2]

ustring xtd::ustring::remove ( size_t  start_index,
size_t  count 
) const
noexcept

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
A new string object that is equivalent to this string less the removed characters.

◆ replace() [1/2]

ustring xtd::ustring::replace ( value_type  old_char,
value_type  new_char 
) const
noexcept

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

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

◆ replace() [2/2]

ustring xtd::ustring::replace ( const ustring old_string,
const ustring new_string 
) const
noexcept

Replaces all occurrences of a specified string in this string with another specified string.

Parameters
old_stringA string to be replaced.
new_stringA string to replace all occurrences of old_string.
Returns
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]

std::vector<ustring> xtd::ustring::split ( const std::vector< value_type > &  separators,
size_t  count,
string_split_options  options 
) const
noexcept

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

Parameters
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]

std::vector<ustring> xtd::ustring::split ( ) const
noexcept

Splits this 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.

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]

std::vector<ustring> xtd::ustring::split ( const std::vector< value_type > &  separators) const
noexcept

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

Parameters
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]

std::vector<ustring> xtd::ustring::split ( const std::vector< value_type > &  separators,
string_split_options  options 
) const
noexcept

Splits this string into substrings based on the characters in an array. You can specify whether the substrings include empty array elements.

Parameters
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]

std::vector<ustring> xtd::ustring::split ( const std::vector< value_type > &  separators,
size_t  count 
) const
noexcept

Splits this 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
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]

bool xtd::ustring::starts_with ( value_type  value) const
noexcept

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

Parameters
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]

bool xtd::ustring::starts_with ( value_type  value,
bool  ignore_case 
) const
noexcept

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

Parameters
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]

bool xtd::ustring::starts_with ( const ustring value) const
noexcept

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

Parameters
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]

bool xtd::ustring::starts_with ( const ustring value,
bool  ignore_case 
) const
noexcept

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

Parameters
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]

ustring xtd::ustring::substring ( size_t  start_index) const
noexcept

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
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]

ustring xtd::ustring::substring ( size_t  start_index,
size_t  length 
) const
noexcept

Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.

Parameters
start_indexThe zero-based starting character position of a substring in this instance.
lengthThe number of characters in the substring.
Returns
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]

std::vector<value_type> xtd::ustring::to_array ( ) const
noexcept

Copies the characters in this instance to a Unicode character 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]

std::vector<value_type> xtd::ustring::to_array ( size_t  start_index) const
noexcept

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

Parameters
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]

std::vector<value_type> xtd::ustring::to_array ( size_t  start_index,
size_t  length 
) const
noexcept

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

Parameters
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()

ustring xtd::ustring::to_lower ( ) const
noexcept

Returns a copy of the current string converted to lowercase.

Returns
A new string in lowercase.

◆ to_string()

ustring xtd::ustring::to_string ( ) const
overridevirtualnoexcept

Returns a std::string that represents the current object.

Returns
A string that represents the current object.
Examples
The following code example demonstrates what to_string returns.

Reimplemented from xtd::object.

◆ to_upper()

ustring xtd::ustring::to_upper ( ) const
noexcept

Returns a copy of the current string converted to uppercase.

Returns
A new string in uppercase.

◆ trim() [1/3]

ustring xtd::ustring::trim ( ) const
noexcept

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]

ustring xtd::ustring::trim ( value_type  trim_char) const
noexcept

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]

ustring xtd::ustring::trim ( const std::vector< value_type > &  trim_chars) const
noexcept

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]

ustring xtd::ustring::trim_end ( ) const
noexcept

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]

ustring xtd::ustring::trim_end ( value_type  trim_char) const
noexcept

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]

ustring xtd::ustring::trim_end ( const std::vector< value_type > &  trim_chars) const
noexcept

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]

ustring xtd::ustring::trim_start ( ) const
noexcept

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]

ustring xtd::ustring::trim_start ( value_type  trim_char) const
noexcept

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]

ustring xtd::ustring::trim_start ( const std::vector< value_type > &  trim_chars) const
noexcept

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: