Represents text as a sequence of character units.
char_t
, and unlike std::basic_string<char_t> that value is immutable (that is, it is read-only). char_t
, and unlike std::basic_string<char_t> that value is immutable (that is, it is read-only). Public Methods | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a reference to the character at specified location / / /
/ Compares two character sequences. /
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
int32 | compare (size_type pos1, size_type count1, const_pointer s) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
int32 | compare (size_type pos1, size_type count1, const_pointer s, size_type count2) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Compares two character sequences. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
int32 | compare_to (const object &value) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Compares this instance with a specified xtd::object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified xtd::object. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
int32 | compare_to (const basic_string &value) const noexcept override | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Compares this instance with a specified xtd::basic_string object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
virtual bool | contains (value_type value) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a value indicating whether a specified char occurs within this basic_string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
virtual bool | contains (const basic_string &value) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a value indicating whether a specified substring occurs within this basic_string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool | equals (const object &obj) const noexcept override | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Determines whether this instance and a specified object, which must also be a xtd::basic_string object, have the same value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool | equals (const basic_string &value) const noexcept override | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Determines whether this instance and another specified xtd::basic_string object have the same value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool | equals (const basic_string &value, bool ignore_case) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Determines whether this instance and another specified xtd::basic_string object have the same value, ignoring or honoring their case. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool | ends_with (value_type value) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Determines whether the end of this basic_string matches the specified character. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool | ends_with (value_type value, bool ignore_case) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Determines whether the end of this basic_string matches the specified character, ignoring or honoring their case. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool | ends_with (const basic_string &value) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Determines whether the end of this basic_string matches the specified basic_string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool | ends_with (const basic_string &value, bool ignore_case) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Determines whether the end of this basic_string instance matches the specified basic_string, ignoring or honoring their case. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool | ends_with (const basic_string &value, xtd::string_comparison comparison_type) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Determines whether the end of this basic_string matches the specified basic_string when compared using the specified comparison option. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find (const basic_string &str) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first substring equal to the given character sequence. Search begins at 0 , i.e. the found substring must not begin in a position preceding 0 . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find (const basic_string &str, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first substring equal to the given character sequence. Search begins at pos , i.e. the found substring must not begin in a position preceding pos . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find (const_pointer s, size_type pos, size_type count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first substring equal to the given character sequence. Search begins at pos , i.e. the found substring must not begin in a position preceding pos . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find (const_pointer s) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first substring equal to the given character sequence. Search begins at 0 , i.e. the found substring must not begin in a position preceding 0 . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find (const_pointer s, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first substring equal to the given character sequence. Search begins at pos , i.e. the found substring must not begin in a position preceding pos . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find (value_type ch) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first substring equal to the given character sequence. Search begins at 0 , i.e. the found substring must not begin in a position preceding 0 . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find (value_type ch, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first substring equal to the given character sequence. Search begins at pos , i.e. the found substring must not begin in a position preceding pos . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_of (const basic_string &str) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos , size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. @parzm str The string identifying characters to search for. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_of (const basic_string &str, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos , size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_of (const_pointer s, size_type pos, size_type count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos , size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_of (const_pointer s) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos , size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_of (const_pointer s, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos , size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_of (char_t ch) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos , size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_of (char_t ch, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos , size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_not_of (const basic_string &str) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos , size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned. @parzm str The string identifying characters to search for. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_not_of (const basic_string &str, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos , size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_not_of (const_pointer s, size_type pos, size_type count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos , size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_not_of (const_pointer s) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos , size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_not_of (const_pointer s, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos , size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_not_of (char_t ch) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos , size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_first_not_of (char_t ch, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos , size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_of (const basic_string &str) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0 , pos ]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. @parzm str The string identifying characters to search for. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_of (const basic_string &str, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0 , pos ]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_of (const_pointer s, size_type pos, size_type count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0 , pos ]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_of (const_pointer s) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0 , pos ]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_of (const_pointer s, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0 , pos ]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_of (char_t ch) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0 , pos ]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_of (char_t ch, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0 , pos ]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_not_of (const basic_string &str) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0 , pos ]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned. @parzm str The string identifying characters to search for. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_not_of (const basic_string &str, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0 , pos ]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_not_of (const_pointer s, size_type pos, size_type count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0 , pos ]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_not_of (const_pointer s) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0 , pos ]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_not_of (const_pointer s, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0 , pos ]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_not_of (char_t ch) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0 , pos ]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | find_last_not_of (char_t ch, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0 , pos ]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
allocator_type | get_allocator () const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the allocator associated with the string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
virtual const base_type & | get_base_type () const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the underlying base type. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | get_hash_code () const noexcept override | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the hash code for this basic_string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
enumerator_type | get_enumerator () const noexcept override | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns an enumerator that iterates through a collection. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | index_of (const basic_string &value) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the first occurrence of the specified basic_string in this basic_string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | index_of (const basic_string &value, xtd::size start_index) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the first occurrence of the specified character in this basic_string. The search starts at a specified character position. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | index_of (const basic_string &value, xtd::size start_index, xtd::size count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the first occurrence of the specified character in this basic_string. The search starts at a specified character position and examines a specified number of character positions. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | index_of (value_type value) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the first occurrence of the specified character in this basic_string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | index_of (value_type value, xtd::size start_index) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the first occurrence of the specified character in this basic_string. The search starts at a specified character position. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | index_of (value_type value, xtd::size start_index, xtd::size count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the first occurrence of the specified character in this basic_string. The search starts at a specified character position and examines a specified number of character positions. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | index_of_any (const xtd::array< value_type > &values) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the first occurrence in this instance of any character in a specified array of characters. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | index_of_any (const xtd::array< value_type > &values, xtd::size start_index) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | index_of_any (const xtd::array< value_type > &values, xtd::size start_index, xtd::size count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | insert (xtd::size start_index, const basic_string &value) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Inserts a specified instance of basic_string at a specified index position in this instance. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool | is_empty () const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Indicates whether this basic_string is an empty basic_string (""). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | last_index_of (const basic_string &value) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the last occurrence of the specified basic_string in this basic_string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | last_index_of (const basic_string &value, xtd::size start_index) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the last occurrence of the specified character in this basic_string. The search starts at a specified character position. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | last_index_of (const basic_string &value, xtd::size start_index, xtd::size count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the last occurrence of the specified character in this basic_string. The search starts at a specified character position and examines a specified number of character positions. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | last_index_of (value_type value) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the last occurrence of the specified character in this tring. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | last_index_of (value_type value, xtd::size start_index) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the last occurrence of the specified character in this basic_string. The search starts at a specified character position. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | last_index_of (value_type value, xtd::size start_index, xtd::size count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the last occurrence of the specified character in this basic_string. The search starts at a specified character position and examines a specified number of character positions. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | last_index_of_any (const xtd::array< value_type > &values) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reports the index of the last occurrence in this instance of any character in a specified array of characters. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | last_index_of_any (const xtd::array< value_type > &values, xtd::size start_index) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
xtd::size | last_index_of_any (const xtd::array< value_type > &values, xtd::size start_index, xtd::size count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | pad_left (xtd::size total_width) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Right-aligns the characters in this basic_string, padding with spaces on the left for a specified total length. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | pad_left (xtd::size total_width, char32 padding_char) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Right-aligns the characters in this basic_string, padding with spaces on the left for a specified total length. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | pad_right (xtd::size total_width) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Left-aligns the characters in this basic_string, padding with spaces on the right for a specified total length. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | pad_right (xtd::size total_width, char32 padding_char) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Left-aligns the characters in this basic_string, padding with spaces on the right for a specified total length. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | quoted () const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | quoted (value_type delimiter) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified delimiter. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | quoted (value_type delimiter, value_type escape) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified delimiter and escape. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | remove (xtd::size start_index) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Deletes all the characters from this basic_string beginning at a specified position and continuing through the last position. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | remove (xtd::size start_index, xtd::size count) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Deletes all the characters from this basic_string beginning at a specified position and continuing through the last position. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | replace (value_type old_char, value_type new_char) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Replaces all occurrences of a specified char_t in this basic_string with another specified char_t. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
basic_string | replace (const basic_string &old_string, const basic_string &new_string) const noexcept | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Replaces all occurrences of a specified basic_string in this basic_string with another specified basic_string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | rfind (const_pointer s) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last substring that is equal to the given character sequence. The search begins at xtd::basic_string::nposand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following xtd::basic_string::npos). If xtd::basic_string::npos or any value not smaller than xtd::basic_string::size() - 1 is passed as xtd::basic_string::npos, the whole string will be searched. / @return Position of the first character of the found substring or xtd::basic_string::npos if no such substring is found. / @remarks Finds the first substring equal to str. size_type rfind(const basic_string& str) const {return chars_.rfind(str);} / @brief Finds the last substring that is equal to the given character sequence. The search begins at posand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following pos). If xtd::basic_string::npos or any value not smaller than xtd::basic_string::size() - 1 is passed as pos, the whole string will be searched. / @param str The string to search for. / @param pos The position at which to start the search / @return Position of the first character of the found substring or xtd::basic_string::npos if no such substring is found. / @remarks Finds the first substring equal to str. size_type rfind(const basic_string& str, size_type pos) const {return chars_.rfind(str, pos);} / @brief Finds the last substring that is equal to the given character sequence. The search begins at posand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following pos). If xtd::basic_string::npos or any value not smaller than xtd::basic_string::size() - 1 is passed as pos, the whole string will be searched. / @param str The string to search for. / @param pos The position at which to start the search / @param count The length of substring to search for. / @return Position of the first character of the found substring or xtd::basic_string::npos if no such substring is found. / @remarks Finds the first substring equal to the range [s, s + count). / @remarks This range may contain null characters. If [ s, s + count) is not a valid range, the behavior is undefined. size_type rfind(const_pointer s, size_type pos, size_type count) const {return chars_.rfind(s, pos, count);} / @brief Finds the last substring that is equal to the given character sequence. The search begins at xtd::basic_string::npos and proceeds from right to left (thus, the found substring, if any, cannot begin in a position following xtd::basic_string::npos). If xtd::basic_string::npos or any value not smaller than xtd::basic_string::size() - 1 is passed as xtd::basic_string::npos, the whole string will be searched. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
size_type | rfind (const_pointer s, size_type pos) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finds the last substring that is equal to the given character sequence. The search begins at pos and proceeds from right to left (thus, the found substring, if any, cannot begin in a position following pos ). If xtd::basic_string::npos or any value not smaller than xtd::basic_string::size() - 1 is passed as pos , the whole string will be searched. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Additional Inherited Members | |
using | value_type |
Represents the xtd::collections::generic::ienumerable value type. | |
using | iterator |
Represents the iterator of xtd::collections::generic::ienumerable value type. | |
using | const_iterator |
Represents the const iterator of xtd::collections::generic::ienumerable value type. | |
using | iterator |
Represents the iterator of enumarable value type. | |
using | const_iterator |
Represents the const iterator of enumarable value type. | |
using | enumerable_type |
Represents the ienumerable enumerable type. | |
using | source_type |
Represents the ienumerable source type. | |
using | ienumerable |
Represents the ienumerable value type. | |
using | list |
Represents the list value type. | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual type_object | get_type () const noexcept |
Gets the type of the current instance. | |
template<class object_t> | |
xtd::unique_ptr_object< object_t > | memberwise_clone () const |
Creates a shallow copy of the current object. | |
virtual xtd::string | to_string () const noexcept |
Returns a xtd::string that represents the current object. | |
virtual const_iterator | begin () const |
Returns an iterator to the first element of the enumarable. | |
virtual iterator | begin () |
Returns an iterator to the first element of the enumarable. | |
virtual const_iterator | cbegin () const |
Returns an iterator to the first element of the enumarable. | |
virtual const_iterator | cend () const |
Returns an iterator to the element following the last element of the enumarable. | |
virtual const_iterator | end () const |
Returns an iterator to the element following the last element of the enumarable. | |
virtual iterator | end () |
Returns an iterator to the element following the last element of the enumarable. | |
char_t | aggregate (const std::function< char_t(const char_t &, const char_t &)> &func) const |
Applies an accumulator function over a sequence. | |
char_t | aggregate (const char_t &seed, const std::function< char_t(const char_t &, const char_t &)> &func) const |
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. | |
accumulate_t | aggregate (const accumulate_t &seed, const std::function< accumulate_t(const char_t &, const accumulate_t &)> &func) const |
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. | |
char_t | aggregate (const char_t &seed, const std::function< char_t(const char_t &, const char_t &)> &func, const std::function< char_t(const char_t &)> &result_selector) const |
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. | |
result_t | aggregate (const accumulate_t &seed, const std::function< accumulate_t(const char_t &, const accumulate_t &)> &func, const std::function< result_t(const accumulate_t &)> &result_selector) const |
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. | |
bool | all (const std::function< bool(const char_t &)> &predicate) const |
Determines whether all elements of a sequence satisfy a condition. | |
bool | any () const noexcept |
Determines whether a sequence contains any elements. | |
bool | any (const std::function< bool(const char_t &)> &predicate) const |
Determines whether any element of a sequence satisfies a condition. | |
const ienumerable< char_t > & | append (const char_t &element) const noexcept |
Appends a value to the end of the sequence. | |
const ienumerable< char_t > & | as_enumerable () const noexcept |
Returns the input typed as xtd::collections::generic::ienumerable <type_t>. | |
auto | average () const noexcept |
Computes the average of a sequence of source_t values. | |
const ienumerable< result_t > & | cast () const noexcept |
Casts the elements of an xtd::collections::generic::ienumerable to the specified type. | |
const ienumerable< xtd::array< char_t > > & | chunk (size_t size) const |
Splits the elements of a sequence into chunks of size at most size. | |
const ienumerable< char_t > & | concat (const ienumerable< char_t > &second) const noexcept |
Concatenates two sequences. | |
bool | contains (const char_t &value) const noexcept |
Determines whether a sequence contains a specified element by using the default equality comparer. | |
bool | contains (const char_t &value, const xtd::collections::generic::iequality_comparer< char_t > &comparer) const noexcept |
Determines whether a sequence contains a specified element by using a specified equality comparer. | |
size_t | count () const noexcept |
Returns the number of elements in current sequence. | |
size_t | count (const std::function< bool(const char_t &)> &predicate) const noexcept |
Returns a number that represents how many elements in the specified sequence satisfy a condition. | |
xtd::size | count (const char_t &value) const noexcept |
Returns the number of elements with the specified value. | |
const ienumerable< key_value_pair< key_t, xtd::size > > & | count_by (const std::function< key_t(const char_t &)> &key_selector) const noexcept |
Returns the count of elements in the current sequence grouped by key. | |
const ienumerable< key_value_pair< key_t, xtd::size > > & | count_by (const std::function< key_t(const char_t &)> &key_selector, const iequality_comparer< key_t > &key_comparer) const noexcept |
Returns the count of elements in the current sequence grouped by key. | |
const ienumerable< char_t > & | default_if_empty () const noexcept |
Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the current sequence is empty. | |
const ienumerable< char_t > & | default_if_empty (const char_t &default_value) const noexcept |
Returns the elements of the specified sequence or the specified value in a singleton collection if the current sequence is empty. | |
char_t | first_or_default (const std::function< bool(const char_t &)> &predicate, const char_t &default_value) const noexcept |
Returns the first element of the sequence that satisfies a condition, or a specified default value if no such element is found. | |
char_t | first_or_default (const std::function< bool(const char_t &)> &predicate) const noexcept |
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. | |
char_t | first_or_default (const char_t default_value) const noexcept |
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. | |
char_t | first_or_default () const noexcept |
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. | |
const ienumerable< result_t > & | select (const std::function< result_t(const char_t &)> &selector) const |
Projects each element of a sequence into a new form. | |
const ienumerable< char_t > & | select (const std::function< char_t(const char_t &)> &selector) const |
Projects each element of a sequence into a new form. | |
const ienumerable< result_t > & | select (const std::function< result_t(const char_t &, size_t index)> &selector) const |
Projects each element of a sequence into a new form by incorporating the element's index. | |
const ienumerable< char_t > & | select (const std::function< char_t(const char_t &, size_t index)> &selector) const |
Projects each element of a sequence into a new form by incorporating the element's index. | |
const list< char_t > & | to_list () const noexcept |
Creates a xtd::collections::generic::list <type_t> from an xtd::collections::generic::ienumerable <type_t>. | |
const ienumerable< char_t > & | where (const std::function< bool(const char_t &)> &predicate) const |
Filters a sequence of values based on a predicate. | |
const ienumerable< char_t > & | where (const std::function< bool(const char_t &, size_t)> &predicate) const |
Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function. | |
template<class object_a_t, class object_b_t> | |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
template<class object_a_t, class object_b_t> | |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
static target_collection_t::const_iterator | to_iterator (typename source_collection_t::const_iterator &value, const source_collection_t &source_collection, const target_collection_t &target_collection) noexcept |
Converts source iterator to target iterator. | |
static target_collection_t::iterator | to_iterator (typename source_collection_t::iterator &value, const source_collection_t &source_collection, const target_collection_t &target_collection) noexcept |
Converts source iterator to target iterator. | |
static target_collection_t::const_iterator | to_iterator (typename source_collection_t::const_iterator &value, source_collection_t &source_collection, target_collection_t &target_collection) noexcept |
Converts source iterator to target iterator. | |
static target_collection_t::iterator | to_iterator (typename source_collection_t::iterator &value, source_collection_t &source_collection, target_collection_t &target_collection) noexcept |
Converts source iterator to target iterator. | |
|
inline |
Compares two character sequences.
pos1 | The position of the first character in this string to compare. |
count1 | The number of characters of this string to compare. |
s | pointer to the character string to compare to. |
count2 | The number of characters of the given string to compare. |
*this
appears before the character sequence specified by the arguments, in lexicographical order.*this
appears after the character sequence specified by the arguments, in lexicographical order. pos1
, pos1 + count1
) substring of this string to the characters in the range [s
, s + count2
). The characters in [s
, s + count2
) may include null characters.
count1
characters starting at data1
is compared to a character sequence consisting of count2
characters starting at data2
as follows:size_type rlen = std::min(count1, count2)
.traits_t::compare(data1, data2, rlen)
. For standard strings this function performs character-by-character lexicographical comparison. If the result is zero (the character sequences are equal so far), then their sizes are compared as follows: Condition | Result | Return value |
---|---|---|
traits_t::compare(data1, data2, rlen) < 0 | data1 is less than data2 | < 0 |
traits_t::compare(data1, data2, rlen) == 0 and size1 < size2 | data1 is less than data2 | < 0 |
traits_t::compare(data1, data2, rlen) == 0 and size1 == size2 | data1 is equal to data2 | 0 |
traits_t::compare(data1, data2, rlen) == 0 and size1 > size2 | data1 is greater than data2 | > 0 |
traits_t::compare(data1, data2, rlen) > 0 | data1 is greater than data2 | > 0 |
|
inline |
Compares this instance with a specified xtd::object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified xtd::object.
value | An object that evaluates to a xtd::basic_string. |
Value | Condition |
---|---|
Less than zero | This instance precedes value . |
Zero | This instance has the same position in the sort order as value . |
Greater than zero | This instance follows value . |
xtd::argument_exception | `value` is not a xtd::basic_string. |
|
inlineoverridevirtualnoexcept |
Compares this instance with a specified xtd::basic_string object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified string.
value | The string to compare with this instance. |
value
parameter. Value | Condition |
---|---|
Less than zero | This instance precedes value . |
Zero | This instance has the same position in the sort order as value . |
Greater than zero | This instance follows value . |
Implements xtd::icomparable< basic_string< char_t, traits_t, allocator_t > >.
|
inlinevirtualnoexcept |
Returns a value indicating whether a specified char occurs within this basic_string.
value | The char to seek. |
true
if the value parameter occurs within this basic_string; otherwise, false
.
|
inlinevirtualnoexcept |
Returns a value indicating whether a specified substring occurs within this basic_string.
value | The basic_string to seek. |
true
if the value parameter occurs within this basic_string, or if value is the empty basic_string (""); otherwise, false
.
|
inlineoverridevirtualnoexcept |
Determines whether this instance and a specified object, which must also be a xtd::basic_string object, have the same value.
obj | The basic_string to compare to this instance. |
true
if obj
is a xtd::basic_string and its value is the same as this instance; otherwise, false
. Reimplemented from xtd::object.
|
inlineoverridevirtualnoexcept |
Determines whether this instance and another specified xtd::basic_string object have the same value.
value | The basic_string to compare to this instance. |
true
if the value
of the value parameter is the same as the value of this instance; otherwise, false
. Implements xtd::iequatable< basic_string< char_t, traits_t, allocator_t > >.
|
inlinenoexcept |
Determines whether this instance and another specified xtd::basic_string object have the same value, ignoring or honoring their case.
value | The basic_string to compare to this instance. |
ignore_case | true to ignore case when comparing this instance and value; otherwise, false |
true
if the value
of the value parameter is the same as the value of this instance; otherwise, false
.
|
inlinenoexcept |
Determines whether the end of this basic_string matches the specified character.
value | The char_t to compare to the substring at the end of this instance. |
true
if value matches the end of this instance; otherwise, false
.
|
inlinenoexcept |
Determines whether the end of this basic_string matches the specified character, ignoring or honoring their case.
value | The char_t to compare to the substring at the end of this instance. |
ignore_case | true to ignore case during the comparison; otherwise, false . |
true
if value matches the end of this instance; otherwise, false
.
|
inlinenoexcept |
Determines whether the end of this basic_string matches the specified basic_string.
value | The basic_string to compare to the substring at the end of this instance. |
true
if value matches the end of this instance; otherwise, false
.
|
inlinenoexcept |
Determines whether the end of this basic_string instance matches the specified basic_string, ignoring or honoring their case.
value | The string to compare to the substring at the end of this instance. |
ignore_case | true to ignore case during the comparison; otherwise, false . |
true
if value matches the end of the specified basic_string; otherwise, false
.
|
inlinenoexcept |
Determines whether the end of this basic_string matches the specified basic_string when compared using the specified comparison option.
value | The string to compare to the substring at the end of this instance. |
comparison_type | One of the enumeration values that determines how this basic_string and value are compared. |
true
if value matches the end of the specified basic_string; otherwise, false
.
|
inline |
Finds the first substring equal to the given character sequence. Search begins at 0
, i.e. the found substring must not begin in a position preceding 0
.
str
.
|
inline |
Finds the first substring equal to the given character sequence. Search begins at pos
, i.e. the found substring must not begin in a position preceding pos
.
str | The string to search for. |
pos | The position at which to start the search |
str
.
|
inline |
Finds the first substring equal to the given character sequence. Search begins at pos
, i.e. the found substring must not begin in a position preceding pos
.
str | The string to search for. |
pos | The position at which to start the search |
count | The length of substring to search for. |
s
, s + count
) is not a valid range, the behavior is undefined.
|
inline |
Finds the first substring equal to the given character sequence. Search begins at 0
, i.e. the found substring must not begin in a position preceding 0
.
s | The pointer to a character string to search for. |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.
|
inline |
Finds the first substring equal to the given character sequence. Search begins at pos
, i.e. the found substring must not begin in a position preceding pos
.
s | The pointer to a character string to search for. |
pos | The position at which to start the search |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.
|
inline |
Finds the first substring equal to the given character sequence. Search begins at 0
, i.e. the found substring must not begin in a position preceding 0
.
ch | The character to search for. |
ch
(treated as a single-character substring by the formal rules below).
|
inline |
Finds the first substring equal to the given character sequence. Search begins at pos
, i.e. the found substring must not begin in a position preceding pos
.
ch | The character to search for. |
pos | The position at which to start the search |
ch
(treated as a single-character substring by the formal rules below).
|
inline |
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos
, size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. @parzm str The string identifying characters to search for.
str
.
|
inline |
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos
, size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
str | The string identifying characters to search for. |
pos | The position at which to begin searching. |
str
.
|
inline |
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos
, size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
pos | The position at which to begin searching. |
count | The length of character string identifying characters to search for. |
s
, s + count
). This range can include null characters. s
, s + count
) is not a valid range, the behavior is undefined.
|
inline |
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos
, size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.
|
inline |
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos
, size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
pos | The position at which to begin searching. |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.
|
inline |
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos
, size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
ch | The character to search for. |
ch
.
|
inline |
Finds the first character equal to one of the characters in the given character sequence. The search considers only the range [pos
, size()). If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
ch | The character to search for. |
pos | The position at which to begin searching. |
ch
.
|
inline |
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos
, size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned. @parzm str The string identifying characters to search for.
str
.
|
inline |
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos
, size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned.
str | The string identifying characters to search for. |
pos | The position at which to begin searching. |
str
.
|
inline |
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos
, size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
pos | The position at which to begin searching. |
count | The length of character string identifying characters to search for. |
s
, s + count
). This range can include null characters. s
, s + count
) is not a valid range, the behavior is undefined.
|
inline |
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos
, size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.
|
inline |
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos
, size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
pos | The position at which to begin searching. |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.
|
inline |
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos
, size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned.
ch | The character to search for. |
ch
.
|
inline |
Finds the first character equal to none of the characters in the given character sequence. The search considers only the range [pos
, size()). If all characters in the range can be found in the given character sequence, xtd::basic_string::npos will be returned.
ch | The character to search for. |
pos | The position at which to begin searching. |
ch
.
|
inline |
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0
, pos
]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned. @parzm str The string identifying characters to search for.
str
.
|
inline |
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0
, pos
]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
str | The string identifying characters to search for. |
pos | The position at which to begin searching. |
str
.
|
inline |
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0
, pos
]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
pos | The position at which to begin searching. |
count | The length of character string identifying characters to search for. |
s
, s + count
). This range can include null characters. s
, s + count
) is not a valid range, the behavior is undefined.
|
inline |
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0
, pos
]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.
|
inline |
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0
, pos
]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
pos | The position at which to begin searching. |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.
|
inline |
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0
, pos
]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
ch | The character to search for. |
ch
.
|
inline |
Finds the last character equal to one of characters in the given character sequence. The exact search algorithm is not specified. The search considers only the range [0
, pos
]. If none of the characters in the given character sequence is present in the range, xtd::basic_string::npos will be returned.
ch | The character to search for. |
pos | The position at which to begin searching. |
ch
.
|
inline |
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0
, pos
]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned. @parzm str The string identifying characters to search for.
str
.
|
inline |
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0
, pos
]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned.
str | The string identifying characters to search for. |
pos | The position at which to begin searching. |
str
.
|
inline |
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0
, pos
]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
pos | The position at which to begin searching. |
count | The length of character string identifying characters to search for. |
s
, s + count
). This range can include null characters. s
, s + count
) is not a valid range, the behavior is undefined.
|
inline |
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0
, pos
]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.
|
inline |
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0
, pos
]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned.
s | The pointer to a character string identifying characters to search for. |
pos | The position at which to begin searching. |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.
|
inline |
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0
, pos
]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned.
ch | The character to search for. |
ch
.
|
inline |
Finds the last character equal to none of the characters in the given character sequence. The search considers only the range [0
, pos
]. If all characters in the range can be found in the given character sequence,xtd::basic_string::npos will be returned.
ch | The character to search for. |
pos | The position at which to begin searching. |
ch
.
|
inline |
Returns the allocator associated with the string.
|
inlinevirtualnoexcept |
Returns the underlying base type.
|
inlineoverridevirtualnoexcept |
|
inlineoverridevirtualnoexcept |
Returns an enumerator that iterates through a collection.
Implements xtd::collections::generic::ienumerable< char_t >.
|
inlinenoexcept |
Reports the index of the first occurrence of the specified basic_string in this basic_string.
value | An unicode character to seek |
|
inline |
Reports the index of the first occurrence of the specified character in this basic_string. The search starts at a specified character position.
value | An unicode character to seek |
start_index | The search starting position |
|
inline |
Reports the index of the first occurrence of the specified character in this basic_string. The search starts at a specified character position and examines a specified number of character positions.
value | An unicode character to seek |
start_index | The search starting position |
count | The number of character positions to examine |
xtd::index_out_of_range_exception | start_index + count are greater than the length of this instance. |
|
inlinenoexcept |
Reports the index of the first occurrence of the specified character in this basic_string.
value | An unicode character to seek |
|
inline |
Reports the index of the first occurrence of the specified character in this basic_string. The search starts at a specified character position.
value | An unicode character to seek |
start_index | The search starting position |
|
inline |
Reports the index of the first occurrence of the specified character in this basic_string. The search starts at a specified character position and examines a specified number of character positions.
value | An unicode character to seek |
start_index | The search starting position |
count | The number of character positions to examine |
xtd::index_out_of_range_exception | start_index + count are greater than the length of this instance. |
|
noexcept |
Reports the index of the first occurrence in this instance of any character in a specified array of characters.
values | An unicode character array containing one or more characters to seek |
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::index_of_any | ( | const xtd::array< value_type > & | values, |
xtd::size | start_index ) const |
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.
values | An unicode character array containing one or more characters to seek |
start_index | The search starting position |
xtd::index_out_of_range_exception | start_index + count are greater than the length of this instance. |
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::index_of_any | ( | const xtd::array< value_type > & | values, |
xtd::size | start_index, | ||
xtd::size | count ) const |
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.
values | An unicode character array containing one or more characters to seek |
start_index | The search starting position |
count | The number of character positions to examine. |
xtd::index_out_of_range_exception | start_index + count are greater than the length of this instance. |
|
inline |
Inserts a specified instance of basic_string at a specified index position in this instance.
start_index | The index position of the insertion. |
value | The basic_string to insert. |
|
inlinenoexcept |
Indicates whether this basic_string is an empty basic_string ("").
true
if the value parameter is null or an empty basic_string (""); otherwise, false
.
|
inlinenoexcept |
Reports the index of the last occurrence of the specified basic_string in this basic_string.
value | An unicode character to seek |
|
inline |
Reports the index of the last occurrence of the specified character in this basic_string. The search starts at a specified character position.
value | An unicode character to seek |
start_index | The search starting position |
xtd::index_out_of_range_exception | start_index + count are greater than the length of this instance. |
|
inline |
Reports the index of the last occurrence of the specified character in this basic_string. The search starts at a specified character position and examines a specified number of character positions.
value | An unicode character to seek |
start_index | The search starting position |
count | The number of character positions to examine |
xtd::index_out_of_range_exception | start_index + count are greater than the length of this instance. |
|
inlinenoexcept |
Reports the index of the last occurrence of the specified character in this tring.
value | An unicode character to seek |
|
inline |
Reports the index of the last occurrence of the specified character in this basic_string. The search starts at a specified character position.
value | An unicode character to seek |
start_index | The search starting position |
xtd::index_out_of_range_exception | start_index + count are greater than the length of this instance. |
|
inline |
Reports the index of the last occurrence of the specified character in this basic_string. The search starts at a specified character position and examines a specified number of character positions.
str | A basic_string to find last index of. |
value | An unicode character to seek |
start_index | The search starting position |
count | The number of character positions to examine |
xtd::index_out_of_range_exception | start_index + count are greater than the length of this instance. |
|
noexcept |
Reports the index of the last occurrence in this instance of any character in a specified array of characters.
values | An unicode character array containing one or more characters to seek |
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::last_index_of_any | ( | const xtd::array< value_type > & | values, |
xtd::size | start_index ) const |
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.
values | An unicode character array containing one or more characters to seek |
start_index | The search starting position |
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::last_index_of_any | ( | const xtd::array< value_type > & | values, |
xtd::size | start_index, | ||
xtd::size | count ) const |
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.
values | An unicode character array containing one or more characters to seek |
start_index | The search starting position |
count | The number of character positions to examine. |
|
inlinenoexcept |
Right-aligns the characters in this basic_string, padding with spaces on the left for a specified total length.
total_width | The number of characters in the resulting basic_string, equal to the number of original characters plus any additional padding characters. |
|
inlinenoexcept |
Right-aligns the characters in this basic_string, padding with spaces on the left for a specified total length.
total_width | The number of characters in the resulting basic_string, equal to the number of original characters plus any additional padding characters. |
paddingChar | An unicode padding character. |
|
inlinenoexcept |
Left-aligns the characters in this basic_string, padding with spaces on the right for a specified total length.
totalWidth | The number of characters in the resulting basic_string, equal to the number of original characters plus any additional padding characters. |
|
inlinenoexcept |
Left-aligns the characters in this basic_string, padding with spaces on the right for a specified total length.
totalWidth | The number of characters in the resulting basic_string, equal to the number of original characters plus any additional padding characters. |
paddingChar | An unicode padding character. |
|
inline |
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML.
"by default and the escape is set to
\
by default.
|
inline |
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified delimiter.
delimiter | The character to use as the delimiter, defaults to "</tt>.
@return A new quoted basic_string.
@remarks for more information see <a href="https://en.cppreference.com/w/cpp/io/manip/quoted" >std::quoted. |
|
inline |
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified delimiter and escape.
delimiter | The character to use as the delimiter, defaults to "</tt>.
@param escape The character to use as the escape character, defaults to <tt>\\</tt>.
@return A new quoted basic_string.
@remarks for more information see <a href="https://en.cppreference.com/w/cpp/io/manip/quoted" >std::quoted. |
|
inline |
Deletes all the characters from this basic_string beginning at a specified position and continuing through the last position.
start_index | The position to begin deleting characters. |
|
inline |
Deletes all the characters from this basic_string beginning at a specified position and continuing through the last position.
start_index | The position to begin deleting characters. |
count | The number of characters to delete. |
|
inlinenoexcept |
Replaces all occurrences of a specified char_t in this basic_string with another specified char_t.
old_char | A char_t to be replaced. |
new_char | A char_t to replace all occurrences of old_char. |
|
inlinenoexcept |
Replaces all occurrences of a specified basic_string in this basic_string with another specified basic_string.
old_string | A basic_string to be replaced. |
new_string | A basic_string to replace all occurrences of old_string. |
|
inline |
Finds the last substring that is equal to the given character sequence. The search begins at xtd::basic_string::nposand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following xtd::basic_string::npos). If xtd::basic_string::npos or any value not smaller than xtd::basic_string::size() - 1 is passed as xtd::basic_string::npos, the whole string will be searched. / @return Position of the first character of the found substring or xtd::basic_string::npos if no such substring is found. / @remarks Finds the first substring equal to
str. size_type rfind(const basic_string& str) const {return chars_.rfind(str);} / @brief Finds the last substring that is equal to the given character sequence. The search begins at
posand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following
pos). If xtd::basic_string::npos or any value not smaller than xtd::basic_string::size() - 1 is passed as
pos, the whole string will be searched. / @param str The string to search for. / @param pos The position at which to start the search / @return Position of the first character of the found substring or xtd::basic_string::npos if no such substring is found. / @remarks Finds the first substring equal to
str. size_type rfind(const basic_string& str, size_type pos) const {return chars_.rfind(str, pos);} / @brief Finds the last substring that is equal to the given character sequence. The search begins at
posand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following
pos). If xtd::basic_string::npos or any value not smaller than xtd::basic_string::size() - 1 is passed as
pos, the whole string will be searched. / @param str The string to search for. / @param pos The position at which to start the search / @param count The length of substring to search for. / @return Position of the first character of the found substring or xtd::basic_string::npos if no such substring is found. / @remarks Finds the first substring equal to the range [s, s + count). / @remarks This range may contain null characters. If [
s,
s + count) is not a valid range, the behavior is undefined. size_type rfind(const_pointer s, size_type pos, size_type count) const {return chars_.rfind(s, pos, count);} / @brief Finds the last substring that is equal to the given character sequence. The search begins at xtd::basic_string::npos
and proceeds from right to left (thus, the found substring, if any, cannot begin in a position following xtd::basic_string::npos). If xtd::basic_string::npos or any value not smaller than xtd::basic_string::size() - 1 is passed as xtd::basic_string::npos, the whole string will be searched.
s | The pointer to a character string to search for. |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.
|
inline |
Finds the last substring that is equal to the given character sequence. The search begins at pos
and proceeds from right to left (thus, the found substring, if any, cannot begin in a position following pos
). If xtd::basic_string::npos or any value not smaller than xtd::basic_string::size() - 1 is passed as pos
, the whole string will be searched.
s | The pointer to a character string to search for. |
pos | The position at which to start the search |
s
. The length of the string is determined by the first null character using traits_t::length(s)
. s
, s + traits_t::length(s)
) is not a valid range, the behavior is undefined.