xtd 0.2.0
Loading...
Searching...
No Matches
xtd::basic_string< char_t, traits_t, allocator_t > Class Template Reference
Inheritance diagram for xtd::basic_string< char_t, traits_t, allocator_t >:
xtd::object xtd::icomparable< basic_string< char_t, traits_t, allocator_t > > xtd::iequatable< basic_string< char_t, traits_t, allocator_t > > xtd::collections::generic::ienumerable< char_t > xtd::interface xtd::comparison_operators< type_t, comparable_t > xtd::interface xtd::equality_operators< type_t, equatable_t > xtd::interface xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >

Definition

template<typename char_t, typename traits_t, typename allocator_t>
class xtd::basic_string< char_t, traits_t, allocator_t >

Represents text as a sequence of character units.

Namespace
xtd
Library
xtd.core
Remarks
A basic_string is a sequential collection of characters that's used to represent text. A xtd::basic_string object is a sequential collection of char that represent a basic_string. The value of the xtd::basic_string object is the content of the sequential collection of char_t, and unlike std::basic_string<char_t> that value is immutable (that is, it is read-only).
If you want the same mutable basic_string class, you can use xtd::text::basic_string_builder <char_t> class.
xtd::basic_string implements std::basic_string<char> and therefore offers the full (immutable) API of std::basic_string.
Several aliases for common character types are provided:
Type Definition
xtd::string xtd::basic_string <char>
xtd::u16string xtd::basic_string <xtd::char16>
xtd::u32string xtd::basic_string <xtd::char32>
xtd::u8string xtd::basic_string <xtd::char8>
xtd::wstring xtd::basic_string <xtd::wchar>
Namespace
xtd
Library
xtd.core
Remarks
A basic_string is a sequential collection of characters that's used to represent text. A xtd::basic_string object is a sequential collection of char that represent a basic_string. The value of the xtd::basic_string object is the content of the sequential collection of char_t, and unlike std::basic_string<char_t> that value is immutable (that is, it is read-only).
If you want the same mutable basic_string class, you can use xtd::text::basic_string_builder <char_t> class.
xtd::basic_string implements std::basic_string<char> and therefore offers the full (immutable) API of std::string.
Examples
event.cpp, format_character.cpp, iasync_result.cpp, split.cpp, test_forms.cpp, and test_tunit.cpp.

Public Aliases

using base_type = std::basic_string< char_t, traits_t, allocator_t >
 Represents the basic string base type.
 
using traits_type = typename base_type::traits_type
 Represents the basic string traits type.
 
using value_type = typename base_type::value_type
 Represents the basic string value type.
 
using allocator_type = typename base_type::allocator_type
 Represents the basic string allocator type.
 
using size_type = typename base_type::size_type
 Represents the basic string size type.
 
using difference_type = typename base_type::difference_type
 Represents the basic string difference type.
 
using reference = typename base_type::reference
 Represents the basic string referecne type.
 
using const_reference = typename base_type::const_reference
 Represents the basic string const referecne type.
 
using pointer = typename base_type::pointer
 Represents the basic string pointer type.
 
using const_pointer = typename base_type::const_pointer
 Represents the basic string const pointer type.
 
using iterator = typename xtd::collections::generic::ienumerable< char_t >::iterator
 Represents the basic string iterator type.
 
using const_iterator = typename xtd::collections::generic::ienumerable< char_t >::const_iterator
 Represents the basic string const iterator type.
 
using reverse_iterator = typename base_type::reverse_iterator
 Represents the basic string reverse iterator type.
 
using const_reverse_iterator = typename base_type::const_reverse_iterator
 Represents the basic string const reverse iterator type.
 
using enumerator_type = typename xtd::collections::generic::enumerator< value_type >
 Represents the basic string enumerator type.
 

Public Fields

static const basic_string empty_string
 Represents the empty basic_string.
 
static constexpr size_type npos
 This is a special value equal to the maximum value representable by the type xtd::size.
 

Public Operators

const_reference operator[] (xtd::size index) const
 Returns a reference to the character at specified location index.
 
 operator const base_type & () const noexcept
 Returns a reference to the underlying base type.
 
basic_stringoperator= (const basic_string< char > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const basic_string< xtd::char16 > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const basic_string< xtd::char32 > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const basic_string< xtd::char8 > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const basic_string< xtd::wchar > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (basic_string< char > &&str) noexcept
 Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in str is moved from str into this string). str is in a valid but unspecified state afterwards.
 
basic_stringoperator= (basic_string< xtd::char16 > &&str) noexcept
 Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in str is moved from str into this string). str is in a valid but unspecified state afterwards.
 
basic_stringoperator= (basic_string< xtd::char32 > &&str) noexcept
 Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in str is moved from str into this string). str is in a valid but unspecified state afterwards.
 
basic_stringoperator= (basic_string< xtd::char8 > &&str) noexcept
 Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in str is moved from str into this string). str is in a valid but unspecified state afterwards.
 
basic_stringoperator= (basic_string< xtd::wchar > &&str) noexcept
 Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in str is moved from str into this string). str is in a valid but unspecified state afterwards.
 
basic_stringoperator= (const std::basic_string< char > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const std::basic_string< xtd::char16 > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const std::basic_string< xtd::char32 > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const std::basic_string< xtd::char8 > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const std::basic_string< xtd::wchar > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (std::basic_string< char > &&str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (std::basic_string< xtd::char16 > &&str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (std::basic_string< xtd::char32 > &&str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (std::basic_string< xtd::char8 > &&str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (std::basic_string< xtd::wchar > &&str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const char *str)
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const xtd::char16 *str)
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const xtd::char32 *str)
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const xtd::char8 *str)
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (const xtd::wchar *str)
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_stringoperator= (char character)
 Copy assignment operator. Replaces the contents with the specified character.
 
basic_stringoperator= (xtd::char16 character)
 Copy assignment operator. Replaces the contents with the specified character.
 
basic_stringoperator= (xtd::char32 character)
 Copy assignment operator. Replaces the contents with the specified character.
 
basic_stringoperator= (xtd::char8 character)
 Copy assignment operator. Replaces the contents with the specified character.
 
basic_stringoperator= (xtd::wchar character)
 Copy assignment operator. Replaces the contents with the specified character.
 
basic_stringoperator= (const std::initializer_list< char > &il)
 Copy assignment operator. Replaces the contents with a copy of the contents of the specified initializer list.
 
basic_stringoperator= (const std::initializer_list< xtd::char16 > &il)
 Copy assignment operator. Replaces the contents with a copy of the contents of the specified initializer list.
 
basic_stringoperator= (const std::initializer_list< xtd::char32 > &il)
 Copy assignment operator. Replaces the contents with a copy of the contents of the specified initializer list.
 
basic_stringoperator= (const std::initializer_list< xtd::char8 > &il)
 Copy assignment operator. Replaces the contents with a copy of the contents of the specified initializer list.
 
basic_stringoperator= (const std::initializer_list< xtd::wchar > &il)
 Copy assignment operator. Replaces the contents with a copy of the contents of the specified initializer list.
 
basic_stringoperator+= (const basic_string< char > &str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const basic_string< xtd::char16 > &str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const basic_string< xtd::char32 > &str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const basic_string< xtd::char8 > &str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const basic_string< xtd::wchar > &str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (basic_string< char > &&str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (basic_string< xtd::char16 > &&str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (basic_string< xtd::char32 > &&str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (basic_string< xtd::char8 > &&str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (basic_string< xtd::wchar > &&str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const std::basic_string< char > &str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const std::basic_string< xtd::char16 > &str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const std::basic_string< xtd::char32 > &str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const std::basic_string< xtd::char8 > &str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const std::basic_string< xtd::wchar > &str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const char *str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const xtd::char16 *str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const xtd::char32 *str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const xtd::char8 *str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (const xtd::wchar *str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (char ch)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (xtd::char16 ch)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (xtd::char32 ch)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (xtd::char8 ch)
 Addition assignment operator. Appends additional characters to the string.
 
basic_stringoperator+= (xtd::wchar ch)
 Addition assignment operator. Appends additional characters to the string.
 

Public Constructors

 basic_string ()=default
 Initializes a new instance of xtd::basic_string.
 
 basic_string (const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified allocator.
 
 basic_string (const basic_string< char > &str) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const basic_string< xtd::char16 > &str) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const basic_string< xtd::char32 > &str) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const basic_string< xtd::char8 > &str) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const basic_string< xtd::wchar > &str) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const basic_string< char > &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
 
 basic_string (const basic_string< xtd::char16 > &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
 
 basic_string (const basic_string< xtd::char32 > &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
 
 basic_string (const basic_string< xtd::char8 > &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
 
 basic_string (const basic_string< xtd::wchar > &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
 
 basic_string (const basic_string< char > &str, xtd::size index)
 Initializes a new instance of xtd::basic_string with specified substring at index.
 
 basic_string (const basic_string< xtd::char16 > &str, xtd::size index)
 Initializes a new instance of xtd::basic_string with specified substring at index.
 
 basic_string (const basic_string< xtd::char32 > &str, xtd::size index)
 Initializes a new instance of xtd::basic_string with specified substring at index.
 
 basic_string (const basic_string< xtd::char8 > &str, xtd::size index)
 Initializes a new instance of xtd::basic_string with specified substring at index.
 
 basic_string (const basic_string< xtd::wchar > &str, xtd::size index)
 Initializes a new instance of xtd::basic_string with specified substring at index.
 
 basic_string (const basic_string< char > &str, xtd::size index, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring at index and allocator.
 
 basic_string (const basic_string< xtd::char16 > &str, xtd::size index, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring at index and allocator.
 
 basic_string (const basic_string< xtd::char32 > &str, xtd::size index, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring at index and allocator.
 
 basic_string (const basic_string< xtd::char8 > &str, xtd::size index, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring at index and allocator.
 
 basic_string (const basic_string< xtd::wchar > &str, xtd::size index, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring at index and allocator.
 
 basic_string (const basic_string< char > &str, xtd::size index, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified substring at index and count characters.
 
 basic_string (const basic_string< xtd::char16 > &str, xtd::size index, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified substring at index and count characters.
 
 basic_string (const basic_string< xtd::char32 > &str, xtd::size index, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified substring at index and count characters.
 
 basic_string (const basic_string< xtd::char8 > &str, xtd::size index, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified substring at index and count characters.
 
 basic_string (const basic_string< xtd::wchar > &str, xtd::size index, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified substring at index and count characters.
 
 basic_string (const basic_string< char > &str, xtd::size index, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring at index, count characters and allocator.
 
 basic_string (const basic_string< xtd::char16 > &str, xtd::size index, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring at index, count characters and allocator.
 
 basic_string (const basic_string< xtd::char32 > &str, xtd::size index, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring at index, count characters and allocator.
 
 basic_string (const basic_string< xtd::char8 > &str, xtd::size index, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring at index, count characters and allocator.
 
 basic_string (const basic_string< xtd::wchar > &str, xtd::size index, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring at index, count characters and allocator.
 
 basic_string (basic_string &&)=default
 Initializes a new instance of xtd::basic_string with specified string to move.
 
 basic_string (basic_string &&str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified string to move and allocator.
 
 basic_string (xtd::size count, char character)
 Initializes a new instance of xtd::basic_string with specified count copies of character.
 
 basic_string (xtd::size count, char character, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified count copies of character and specified allocator.
 
 basic_string (xtd::size count, xtd::char16 character)
 Initializes a new instance of xtd::basic_string with specified count copies of character.
 
 basic_string (xtd::size count, xtd::char16 character, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified count copies of character and specified allocator.
 
 basic_string (xtd::size count, xtd::char32 character)
 Initializes a new instance of xtd::basic_string with specified count copies of character.
 
 basic_string (xtd::size count, xtd::char32 character, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified count copies of character and specified allocator.
 
 basic_string (xtd::size count, xtd::char8 character)
 Initializes a new instance of xtd::basic_string with specified count copies of character.
 
 basic_string (xtd::size count, xtd::char8 character, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified count copies of character and specified allocator.
 
 basic_string (xtd::size count, xtd::wchar character)
 Initializes a new instance of xtd::basic_string with specified count copies of character.
 
 basic_string (xtd::size count, xtd::wchar character, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified count copies of character and specified allocator.
 
 basic_string (char character, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified count copies of character.
 
 basic_string (char character, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified count copies of character and specified allocator.
 
 basic_string (xtd::char16 character, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified count copies of character.
 
 basic_string (xtd::char16 character, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified count copies of character and specified allocator.
 
 basic_string (xtd::char32 character, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified count copies of character.
 
 basic_string (xtd::char32 character, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified count copies of character and specified allocator.
 
 basic_string (xtd::char8 character, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified count copies of character.
 
 basic_string (xtd::char8 character, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified count copies of character and specified allocator.
 
 basic_string (xtd::wchar character, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified count copies of character.
 
 basic_string (xtd::wchar character, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified count copies of character and specified allocator.
 
 basic_string (const char *str)
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const xtd::char16 *str)
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const xtd::char32 *str)
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const xtd::char8 *str)
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const xtd::wchar *str)
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const char *str, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified string to copy, and allocator.
 
 basic_string (const xtd::char16 *str, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified string to copy, and allocator.
 
 basic_string (const xtd::char32 *str, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified string to copy, and allocator.
 
 basic_string (const xtd::char8 *str, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified string to copy, and allocator.
 
 basic_string (const xtd::wchar *str, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified string to copy, and allocator.
 
 basic_string (const char *str, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified substring and count characters.
 
 basic_string (const xtd::char16 *str, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified substring and count characters.
 
 basic_string (const xtd::char32 *str, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified substring and count characters.
 
 basic_string (const xtd::char8 *str, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified substring and count characters.
 
 basic_string (const xtd::wchar *str, xtd::size count)
 Initializes a new instance of xtd::basic_string with specified substring and count characters.
 
 basic_string (const char *str, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring, count characters and allocator.
 
 basic_string (const xtd::char16 *str, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring, count characters and allocator.
 
 basic_string (const xtd::char32 *str, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring, count characters and allocator.
 
 basic_string (const xtd::char8 *str, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring, count characters and allocator.
 
 basic_string (const xtd::wchar *str, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified substring, count characters and allocator.
 
 basic_string (const std::basic_string< char > &str) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const std::basic_string< xtd::char16 > &str) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const std::basic_string< xtd::char32 > &str) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const std::basic_string< xtd::char8 > &str) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const std::basic_string< xtd::wchar > &str) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy.
 
 basic_string (const std::basic_string< char > &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
 
 basic_string (const std::basic_string< xtd::char16 > &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
 
 basic_string (const std::basic_string< xtd::char32 > &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
 
 basic_string (const std::basic_string< xtd::char8 > &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
 
 basic_string (const std::basic_string< xtd::wchar > &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
 
template<typename input_iterator_t >
 basic_string (input_iterator_t first, input_iterator_t last)
 Initializes a new instance of xtd::basic_string with specified first and last iterators of substring.
 
template<typename input_iterator_t >
 basic_string (input_iterator_t first, input_iterator_t last, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified first and last iterators of substring and allocator.
 
template<typename string_view_like_t >
constexpr basic_string (const string_view_like_t &string_view)
 Initializes a new instance of xtd::basic_string with specified string view of substring and allocator.
 
template<typename string_view_like_t >
constexpr basic_string (const string_view_like_t &string_view, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified string view of substring and allocator.
 
template<typename string_view_like_t >
constexpr basic_string (const string_view_like_t &string_view, size_type index, size_type count)
 Initializes a new instance of xtd::basic_string with specified string view of substring and allocator.
 
template<typename string_view_like_t >
constexpr basic_string (const string_view_like_t &string_view, size_type index, size_type count, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified string view of substring and allocator.
 
 basic_string (std::initializer_list< char > il)
 Initializes a new instance of xtd::basic_string with specified initializer list.
 
 basic_string (std::initializer_list< xtd::char16 > il)
 Initializes a new instance of xtd::basic_string with specified initializer list.
 
 basic_string (std::initializer_list< xtd::char32 > il)
 Initializes a new instance of xtd::basic_string with specified initializer list.
 
 basic_string (std::initializer_list< xtd::char8 > il)
 Initializes a new instance of xtd::basic_string with specified initializer list.
 
 basic_string (std::initializer_list< xtd::wchar > il)
 Initializes a new instance of xtd::basic_string with specified initializer list.
 
 basic_string (std::initializer_list< char > il, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified initializer list and allocator.
 
 basic_string (std::initializer_list< xtd::char16 > il, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified initializer list and allocator.
 
 basic_string (std::initializer_list< xtd::char32 > il, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified initializer list and allocator.
 
 basic_string (std::initializer_list< xtd::char8 > il, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified initializer list and allocator.
 
 basic_string (std::initializer_list< xtd::wchar > il, const allocator_type &allocator)
 Initializes a new instance of xtd::basic_string with specified initializer list and allocator.
 

Public Properties

const_reference back () const
 Returns reference to the last character in the string.
 
const_iterator begin () const override
 Returns an iterator to the first character of the string.
 
const_pointer c_str () const noexcept
 Returns a pointer to a null-terminated character array with data equivalent to those stored in the string.
 
size_type capacity () const noexcept
 Returns the number of characters that the string has currently allocated space for.
 
const_iterator cbegin () const override
 Returns an iterator to the first character of the string.
 
const_reverse_iterator crbegin () const
 Returns a reverse iterator to the first character of the string.
 
const base_typechars () const noexcept
 Returns a reference to the underlying base type.
 
const_iterator cend () const override
 Returns an iterator to the character following the last character of the string. This character acts as a placeholder, attempting to access it results in undefined behavior.
 
const_reverse_iterator crend () const
 Returns a reverse iterator to the character following the last character of the string. This character acts as a placeholder, attempting to access it results in undefined behavior.
 
const_pointer data () const noexcept
 Returns a pointer to the underlying array serving as character storage. The pointer is such that the range [data(), data() + size()] is valid and the values in it correspond to the values stored in the string.
 
bool empty () const noexcept
 Checks if the string has no characters, i.e. whether begin() == end().
 
const_iterator end () const override
 Returns an iterator to the character following the last character of the string. This character acts as a placeholder, attempting to access it results in undefined behavior.
 
const_reference front () const
 Returns reference to the first character in the string. The behavior is undefined if empty() is true.
 
size_type length () const noexcept
 Gets the number of characters in the current xtd::basic_string object.
 
size_type max_size () const noexcept
 Returns the maximum number of elements the string is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest string.
 
const_reverse_iterator rbegin () const
 Returns a reverse iterator to the first character of the string.
 
const_reverse_iterator rend () const
 Returns a reverse iterator to the character following the last character of the string. This character acts as a placeholder, attempting to access it results in undefined behavior.
 
size_type size () const noexcept
 Returns the number of char_t elements in the string, i.e. std::distance(begin(), end()).
 

Public Methods

const_reference at (size_type pos) const
 Returns a reference to the character at specified location pos.
 
int32 compare (const basic_string &str) const
 Compares two character sequences.
 
int32 compare (size_type pos1, size_type count1, const basic_string &str) const
 Compares two character sequences.
 
int32 compare (size_type pos1, size_type count1, const basic_string &str, size_type pos2) const
 Compares two character sequences.
 
int32 compare (size_type pos1, size_type count1, const basic_string &str, size_type pos2, size_type count2) const
 Compares two character sequences.
 
int32 compare (const_pointer s) const
 Compares two character sequences.
 
int32 compare (size_type pos1, size_type count1, const_pointer s) const
 Compares two character sequences.
 
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_typeget_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 basic_string &str) 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 tostr`.
 
size_type rfind (const basic_string &str, 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.
 
size_type rfind (const_pointer s, size_type pos, size_type count) 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.
 
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. @param s The pointer to a character string 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 character string pointed to bys. The length of the string is determined by the first null character usingtraits_t::length(s). @remarks If [s,s + traits_t::length(s)`) is not a valid range, the behavior is undefined.
 
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.
 
size_type rfind (value_type ch) 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. @param ch The character 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 characterch` (treated as a single-character substring by the formal rules below).
 
size_type rfind (value_type ch, 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.
 
xtd::array< basic_stringsplit () const noexcept
 Splits this basic_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 xtd::char_object::isspace() or std::iswspace() method.
 
xtd::array< basic_stringsplit (value_type separator) const noexcept
 Splits this basic_string into substrings that are based on the characters in an array.
 
xtd::array< basic_stringsplit (value_type separator, xtd::string_split_options options) const noexcept
 Splits this basic_string into substrings based on the characters in an array. You can specify whether the substrings include empty array elements.
 
xtd::array< basic_stringsplit (value_type separator, xtd::size count) const noexcept
 Splits this basic_string into a maximum number of substrings based on the characters in an array. You also specify the maximum number of substrings to return.
 
xtd::array< basic_stringsplit (value_type separator, xtd::size count, xtd::string_split_options options) const noexcept
 Splits this basic_string into a maximum number of substrings based on the characters in an array.
 
xtd::array< basic_stringsplit (const xtd::array< value_type > &separators) const noexcept
 Splits this basic_string into substrings that are based on the characters in an array.
 
xtd::array< basic_stringsplit (const xtd::array< value_type > &separators, xtd::string_split_options options) const noexcept
 Splits this basic_string into substrings based on the characters in an array. You can specify whether the substrings include empty array elements.
 
xtd::array< basic_stringsplit (const xtd::array< value_type > &separators, xtd::size count) const noexcept
 Splits this basic_string into a maximum number of substrings based on the characters in an array. You also specify the maximum number of substrings to return.
 
xtd::array< basic_stringsplit (const xtd::array< value_type > &separators, xtd::size count, xtd::string_split_options options) const noexcept
 Splits this basic_string into a maximum number of substrings based on the characters in an array.
 
bool starts_with (value_type value) const noexcept
 Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic_string.
 
bool starts_with (value_type value, bool ignore_case) const noexcept
 Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic_string, ignoring or honoring their case.
 
bool starts_with (const basic_string &value) const noexcept
 Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic_string.
 
bool starts_with (const basic_string &value, bool ignore_case) const noexcept
 Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic_string, ignoring or honoring their case.
 
bool starts_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.
 
basic_string substr () const
 Returns a substring [pos, pos + count). If the requested substring extends past the end of the string, i.e. the count is greater than size() - pos (e.g. if count == xtd::basic_string::npos), the returned substring is [pos, size()).
 
basic_string substr (size_type pos) const
 Returns a substring [pos, pos + count). If the requested substring extends past the end of the string, i.e. the count is greater than size() - pos (e.g. if count == xtd::basic_string::npos), the returned substring is [pos, size()).
 
basic_string substr (size_type pos, size_type count) const
 Returns a substring [pos, pos + count). If the requested substring extends past the end of the string, i.e. the count is greater than size() - pos (e.g. if count == xtd::basic_string::npos), the returned substring is [pos, size()).
 
basic_string substring (xtd::size start_index) const
 Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.
 
basic_string substring (xtd::size start_index, xtd::size length) const
 Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.
 
xtd::array< value_typeto_array () const noexcept
 Copies the characters in this instance to a Unicode character array.
 
xtd::array< value_typeto_array (xtd::size start_index) const
 Copies the characters in this instance to a Unicode character array starting at specified index.
 
xtd::array< value_typeto_array (xtd::size start_index, xtd::size length) const
 Copies the characters in this instance to a Unicode character array starting at specified index with specified length.
 
xtd::array< value_typeto_char_array () const noexcept
 Copies the characters in this instance to a Unicode character array.
 
xtd::array< value_typeto_char_array (xtd::size start_index, xtd::size length) const
 Copies the characters in this instance to a Unicode character array starting at specified index with specified length.
 
basic_string to_lower () const noexcept
 Returns a copy of the current xtd::basic_string converted to lowercase.
 
basic_string< char > to_string () const noexcept override
 Converts the value of this instance to a xtd::basic_string <char>.
 
basic_string to_title_case () const noexcept
 Converts the current basic_string to title case (except for words that are entirely in uppercase, which are considered to be acronyms).
 
basic_string< xtd::char16to_u16string () const noexcept
 Converts the value of this instance to a xtd::basic_string <xtd::char16>.
 
basic_string< xtd::char32to_u32string () const noexcept
 Converts the value of this instance to a xtd::basic_string <xtd::char32>.
 
basic_string< xtd::char8to_u8string () const noexcept
 Converts the value of this instance to a xtd::basic_string <xtd::char8>.
 
basic_string to_upper () const noexcept
 Returns a copy of the current xtd::basic_string converted to uppercase.
 
basic_string< xtd::wcharto_wstring () const noexcept
 Converts the value of this instance to a xtd::basic_string <xtd::wchar>.
 
basic_string trim () const noexcept
 Removes all leading and trailing occurrences of white-space characters from the specified xtd::basic_string.
 
basic_string trim (value_type trim_char) const noexcept
 Removes all leading and trailing occurrences of a character specified from the specified xtd::basic_string .
 
basic_string trim (const xtd::array< value_type > &trim_chars) const noexcept
 Removes all leading and trailing occurrences of a set of characters specified in an array from the specified xtd::basic_string.
 
basic_string trim_end () const noexcept
 Removes all trailing occurrences of white-space characters from the specified xtd::basic_string.
 
basic_string trim_end (value_type trim_char) const noexcept
 Removes all trailing occurrences of a character specified from the specified xtd::basic_string .
 
basic_string trim_end (const xtd::array< value_type > &trim_chars) const noexcept
 Removes all trailing occurrences of a set of characters specified in an array from the specified xtd::basic_string.
 
basic_string trim_start () const noexcept
 Removes all leading occurrences of white-space characters from the specified xtd::basic_string.
 
basic_string trim_start (value_type trim_char) const noexcept
 Removes all leading occurrences of a character specified from the specified xtd::basic_string .
 
basic_string trim_start (const xtd::array< value_type > &trim_chars) const noexcept
 Removes all leading occurrences of a set of characters specified in an array from the specified xtd::basic_string.
 

Public Static Methods

template<typename object_t >
static basic_string class_name ()
 Gets the class name of the object_t.
 
template<typename object_t >
static basic_string class_name (const object_t &object)
 Gets the class name of the specified object.
 
static basic_string class_name (const std::type_info &info)
 Gets the class name of the specified object.
 
static int32 compare (const basic_string &str_a, const basic_string &str_b) noexcept
 Compares two specified basic_string objects and returns an integer that indicates their relative position in the sort order.
 
static int32 compare (const basic_string &str_a, const basic_string &str_b, bool ignore_case) noexcept
 Compares two specified basic_string objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order.
 
static int32 compare (const basic_string &str_a, const basic_string &str_b, xtd::string_comparison comparison_type) noexcept
 Compares two specified basic_string objects using the specified rules, and returns an integer that indicates their relative position in the sort order.
 
static int32 compare (const basic_string &str_a, xtd::size index_a, const basic_string &str_b, xtd::size index_b, xtd::size length)
 Compares substrings of two specified basic_string objects and returns an integer that indicates their relative position in the sort order.
 
static int32 compare (const basic_string &str_a, xtd::size index_a, const basic_string &str_b, xtd::size index_b, xtd::size length, bool ignore_case)
 Compares substrings of two specified basic_string objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order.
 
static int32 compare (const basic_string &str_a, xtd::size index_a, const basic_string &str_b, xtd::size index_b, xtd::size length, xtd::string_comparison comparison_type)
 Compares substrings of two specified basic_string objects using the specified rules, and returns an integer that indicates their relative position in the sort order.
 
static basic_string concat (const basic_string &str_a, const basic_string &str_b, const basic_string &str_c, const basic_string &str_d) noexcept
 Concatenates four specified instances of basic_string.
 
template<typename object_a_t , typename object_b_t , typename object_c_t , typename object_d_t >
static basic_string 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.
 
static basic_string concat (const basic_string &str_a, const basic_string &str_b, const basic_string &str_c) noexcept
 Concatenates three specified instances of basic_string.
 
template<typename object_a_t , typename object_b_t , typename object_c_t >
static basic_string concat (object_a_t obj_a, object_b_t obj_b, object_c_t obj_c) noexcept
 Concatenates three specified instances of object.
 
static basic_string concat (const basic_string &str_a, const basic_string &str_b) noexcept
 Concatenates two specified instances of basic_string.
 
template<typename object_a_t , typename object_b_t >
static basic_string concat (object_a_t obj_a, object_b_t obj_b) noexcept
 Concatenates two specified instances of object.
 
static basic_string concat (const xtd::array< basic_string > &values) noexcept
 Concatenates the elements of a specified basic_string array.
 
template<typename object_t >
static basic_string concat (const xtd::array< object_t > &args) noexcept
 Concatenates the basic_string representations of the elements in a specified object array.
 
template<typename value_t >
static basic_string concat (value_t value) noexcept
 Creates the basic_string representation of a specified object.
 
static basic_string demangle (const basic_string &name)
 Gets demangled basic_string of name,.
 
static bool equals (const basic_string &a, const basic_string &b) noexcept
 Determines whether two specified xtd::basic_string objects have the same value.
 
template<typename char_a_t , typename char_b_t >
static bool equals (const char_a_t *a, const char_b_t *b) noexcept
 Determines whether two specified xtd::basic_string objects have the same value.
 
static bool equals (const basic_string &a, const basic_string &b, bool ignore_case) noexcept
 Determines whether two specified xtd::basic_string objects have the same value, ignoring or honoring their case.
 
template<typename char_a_t , typename char_b_t >
static bool equals (const char_a_t *a, const char_b_t *b, bool ignore_case) noexcept
 Determines whether two specified xtd::basic_string objects have the same value, ignoring or honoring their case.
 
template<typename ... args_t>
static basic_string format (const basic_string< char > &fmt, args_t &&... args)
 Writes the text representation of the specified arguments list, to string using the specified format information.
 
template<typename object_t >
static basic_string full_class_name ()
 Gets the fully qualified class name of the objec_t, including the namespace of the objec_t.
 
template<typename object_t >
static basic_string full_class_name (const object_t &object)
 Gets the fully qualified class name of the specified object, including the namespace of the specified object.
 
static basic_string 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.
 
static bool is_empty (const xtd::basic_string< value_type, traits_type, allocator_type > &string) noexcept
 Indicates whether the specifeid basic_string is an empty basic_string ("").
 
template<typename collection_t >
static basic_string join (const basic_string separator, const collection_t &values) noexcept
 Concatenates a specified separator basic_string between each element of a specified object array, yielding a single concatenated basic_string.
 
template<typename collection_t >
static basic_string join (const basic_string &separator, const collection_t &values, xtd::size index)
 Concatenates a specified separator basic_string between each element of a specified object array, yielding a single concatenated basic_string.
 
template<typename collection_t >
static basic_string join (const basic_string &separator, const collection_t &values, xtd::size index, xtd::size count)
 Concatenates a specified separator basic_string between each element of a specified Object array, yielding a single concatenated basic_string.
 
template<typename value_t >
static value_t parse (const basic_string &str)
 Converts a basic_string into a value_t type.
 
template<typename ... args_t>
static basic_string sprintf (const basic_string &fmt, args_t &&... args) noexcept
 Writes the text representation of the specified arguments list, to basic_string using the specified format information.
 
template<typename value_t >
static bool try_parse (const basic_string &str, value_t &value) noexcept
 Try to convert a basic_string into a value_t type.
 

Additional Inherited Members

- Public Types inherited from xtd::collections::generic::ienumerable< char_t >
using iterator = typename enumerable_iterators< char_t, ienumerable< char_t > >::iterator
 Represents the iterator of xtd::collections::generic::ienumerable value type.
 
using const_iterator = typename enumerable_iterators< char_t, ienumerable< char_t > >::const_iterator
 Represents the const iterator of xtd::collections::generic::ienumerable value type.
 
- Public Types inherited from xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >
using const_iterator = const iterator
 Represents the const iterator of enumarable value type.
 
- Public Member Functions inherited from xtd::object
 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<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
- Public Member Functions inherited from xtd::icomparable< basic_string< char_t, traits_t, allocator_t > >
virtual int32 compare_to (const basic_string< char_t, traits_t, allocator_t > &obj) const noexcept=0
 Compares the current instance with another object of the same type.
 
- Public Member Functions inherited from xtd::iequatable< basic_string< char_t, traits_t, allocator_t > >
virtual bool equals (const basic_string< char_t, traits_t, allocator_t > &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
 
- Public Member Functions inherited from xtd::collections::generic::ienumerable< char_t >
- Public Member Functions inherited from xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >
virtual iterator begin ()
 Returns an iterator to the first element of the enumarable.
 
virtual iterator end ()
 Returns an iterator to the element following the last element of the enumarable.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename 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<typename object_a_t , typename 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.
 

Member Typedef Documentation

◆ base_type

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::base_type = std::basic_string<char_t, traits_t, allocator_t>

Represents the basic string base type.

Remarks
Is equal to std::basic_string<char_t, traits_t, allocator_t>.`

◆ traits_type

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::traits_type = typename base_type::traits_type

Represents the basic string traits type.

◆ value_type

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::value_type = typename base_type::value_type

Represents the basic string value type.

◆ allocator_type

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::allocator_type = typename base_type::allocator_type

Represents the basic string allocator type.

◆ size_type

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::size_type = typename base_type::size_type

Represents the basic string size type.

◆ difference_type

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::difference_type = typename base_type::difference_type

Represents the basic string difference type.

◆ reference

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::reference = typename base_type::reference

Represents the basic string referecne type.

◆ const_reference

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::const_reference = typename base_type::const_reference

Represents the basic string const referecne type.

◆ pointer

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::pointer = typename base_type::pointer

Represents the basic string pointer type.

◆ const_pointer

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::const_pointer = typename base_type::const_pointer

Represents the basic string const pointer type.

◆ iterator

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::iterator = typename xtd::collections::generic::ienumerable<char_t>::iterator

Represents the basic string iterator type.

Todo:
replace xtd::ienumerable::iterator

◆ const_iterator

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::const_iterator = typename xtd::collections::generic::ienumerable<char_t>::const_iterator

Represents the basic string const iterator type.

Todo:
replace xtd::ienumerable::const_iterator

◆ reverse_iterator

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::reverse_iterator = typename base_type::reverse_iterator

Represents the basic string reverse iterator type.

◆ const_reverse_iterator

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::const_reverse_iterator = typename base_type::const_reverse_iterator

Represents the basic string const reverse iterator type.

◆ enumerator_type

template<typename char_t , typename traits_t , typename allocator_t >
using xtd::basic_string< char_t, traits_t, allocator_t >::enumerator_type = typename xtd::collections::generic::enumerator<value_type>

Represents the basic string enumerator type.

Constructor & Destructor Documentation

◆ basic_string() [1/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( )
default

Initializes a new instance of xtd::basic_string.

◆ basic_string() [2/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const allocator_type allocator)
explicitnoexcept

Initializes a new instance of xtd::basic_string with specified allocator.

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

◆ basic_string() [3/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< char > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string() [4/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char16 > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string() [5/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char32 > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string() [6/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char8 > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string() [7/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::wchar > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string() [8/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< char > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string() [9/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char16 > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string() [10/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char32 > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string() [11/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char8 > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string() [12/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::wchar > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string() [13/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< char > &  str,
xtd::size  index 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
Exceptions
xtd::argument_out_of_range_exception`index` is greater or equal than `str` size.

◆ basic_string() [14/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char16 > &  str,
xtd::size  index 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
Exceptions
xtd::argument_out_of_range_exception`index` is greater or equal than `str` size.

◆ basic_string() [15/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char32 > &  str,
xtd::size  index 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
Exceptions
xtd::argument_out_of_range_exception`index` is greater or equal than `str` size.

◆ basic_string() [16/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char8 > &  str,
xtd::size  index 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
Exceptions
xtd::argument_out_of_range_exception`index` is greater or equal than `str` size.

◆ basic_string() [17/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::wchar > &  str,
xtd::size  index 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
Exceptions
xtd::argument_out_of_range_exception`index` is greater or equal than `str` size.

◆ basic_string() [18/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< char > &  str,
xtd::size  index,
const allocator_type allocator 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
allocatorThe allocator to use for all memory allocations of this basic_string.
Exceptions
xtd::argument_out_of_range_exception`index` is greater or equal than `str` size.

◆ basic_string() [19/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char16 > &  str,
xtd::size  index,
const allocator_type allocator 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
allocatorThe allocator to use for all memory allocations of this basic_string.
Exceptions
xtd::argument_out_of_range_exception`index` is greater or equal than `str` size.

◆ basic_string() [20/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char32 > &  str,
xtd::size  index,
const allocator_type allocator 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
allocatorThe allocator to use for all memory allocations of this basic_string.
Exceptions
xtd::argument_out_of_range_exception`index` is greater or equal than `str` size.

◆ basic_string() [21/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char8 > &  str,
xtd::size  index,
const allocator_type allocator 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
allocatorThe allocator to use for all memory allocations of this basic_string.
Exceptions
xtd::argument_out_of_range_exception`index` is greater or equal than `str` size.

◆ basic_string() [22/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::wchar > &  str,
xtd::size  index,
const allocator_type allocator 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
allocatorThe allocator to use for all memory allocations of this basic_string.
Exceptions
xtd::argument_out_of_range_exception`index` is greater or equal than `str` size.

◆ basic_string() [23/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< char > &  str,
xtd::size  index,
xtd::size  count 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
Exceptions
xtd::argument_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string() [24/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char16 > &  str,
xtd::size  index,
xtd::size  count 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
Exceptions
xtd::argument_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string() [25/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char32 > &  str,
xtd::size  index,
xtd::size  count 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
Exceptions
xtd::argument_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string() [26/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char8 > &  str,
xtd::size  index,
xtd::size  count 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
Exceptions
xtd::argument_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string() [27/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::wchar > &  str,
xtd::size  index,
xtd::size  count 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
Exceptions
xtd::argument_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string() [28/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< char > &  str,
xtd::size  index,
xtd::size  count,
const allocator_type allocator 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
allocatorThe allocator to use for all memory allocations of this basic_string.
Exceptions
xtd::argument_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string() [29/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char16 > &  str,
xtd::size  index,
xtd::size  count,
const allocator_type allocator 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
allocatorThe allocator to use for all memory allocations of this basic_string.
Exceptions
xtd::argument_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string() [30/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char32 > &  str,
xtd::size  index,
xtd::size  count,
const allocator_type allocator 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
allocatorThe allocator to use for all memory allocations of this basic_string.
Exceptions
xtd::argument_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string() [31/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::char8 > &  str,
xtd::size  index,
xtd::size  count,
const allocator_type allocator 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
allocatorThe allocator to use for all memory allocations of this basic_string.
Exceptions
xtd::argument_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string() [32/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const basic_string< xtd::wchar > &  str,
xtd::size  index,
xtd::size  count,
const allocator_type allocator 
)
inline

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

Parameters
strThe string to copy.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
allocatorThe allocator to use for all memory allocations of this basic_string.
Exceptions
xtd::argument_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string() [33/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( basic_string< char_t, traits_t, allocator_t > &&  )
default

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

Parameters
strThe basic_string to move.

◆ basic_string() [34/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( basic_string< char_t, traits_t, allocator_t > &&  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string() [35/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::size  count,
char  character 
)
inline

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

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

◆ basic_string() [36/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::size  count,
char  character,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [37/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::size  count,
xtd::char16  character 
)
inline

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

Parameters
countThe number of copies of character.
characterThe character copied.

◆ basic_string() [38/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::size  count,
xtd::char16  character,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [39/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::size  count,
xtd::char32  character 
)
inline

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

Parameters
countThe number of copies of character.
characterThe character copied.

◆ basic_string() [40/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::size  count,
xtd::char32  character,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [41/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::size  count,
xtd::char8  character 
)
inline

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

Parameters
countThe number of copies of character.
characterThe character copied.

◆ basic_string() [42/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::size  count,
xtd::char8  character,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [43/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::size  count,
xtd::wchar  character 
)
inline

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

Parameters
countThe number of copies of character.
characterThe character copied.

◆ basic_string() [44/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::size  count,
xtd::wchar  character,
const allocator_type allocator 
)
inline

Initializes a new instance of xtd::basic_string 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 basic_string.

◆ basic_string() [45/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( char  character,
xtd::size  count 
)
inline

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

Parameters
characterThe character copied.
countThe number of copies of character.

◆ basic_string() [46/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( char  character,
xtd::size  count,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [47/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::char16  character,
xtd::size  count 
)
inline

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

Parameters
characterThe character copied.
countThe number of copies of character.

◆ basic_string() [48/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::char16  character,
xtd::size  count,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [49/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::char32  character,
xtd::size  count 
)
inline

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

Parameters
characterThe character copied.
countThe number of copies of character.

◆ basic_string() [50/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::char32  character,
xtd::size  count,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [51/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::char8  character,
xtd::size  count 
)
inline

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

Parameters
characterThe character copied.
countThe number of copies of character.

◆ basic_string() [52/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::char8  character,
xtd::size  count,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [53/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::wchar  character,
xtd::size  count 
)
inline

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

Parameters
characterThe character copied.
countThe number of copies of character.

◆ basic_string() [54/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( xtd::wchar  character,
xtd::size  count,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [55/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const char *  str)
inline

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

Parameters
strThe string to copy.

◆ basic_string() [56/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char16 str)
inline

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

Parameters
strThe string to copy.

◆ basic_string() [57/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char32 str)
inline

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

Parameters
strThe string to copy.

◆ basic_string() [58/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char8 str)
inline

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

Parameters
strThe string to copy.

◆ basic_string() [59/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::wchar str)
inline

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

Parameters
strThe string to copy.

◆ basic_string() [60/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const char *  str,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [61/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char16 str,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [62/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char32 str,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [63/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char8 str,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [64/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::wchar str,
const allocator_type allocator 
)
inline

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

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

◆ basic_string() [65/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const char *  str,
xtd::size  count 
)
inline

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

Parameters
countThe number of substring characters to copy.

◆ basic_string() [66/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char16 str,
xtd::size  count 
)
inline

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

Parameters
countThe number of substring characters to copy.

◆ basic_string() [67/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char32 str,
xtd::size  count 
)
inline

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

Parameters
countThe number of substring characters to copy.

◆ basic_string() [68/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char8 str,
xtd::size  count 
)
inline

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

Parameters
countThe number of substring characters to copy.

◆ basic_string() [69/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::wchar str,
xtd::size  count 
)
inline

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

Parameters
countThe number of substring characters to copy.

◆ basic_string() [70/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const char *  str,
xtd::size  count,
const allocator_type allocator 
)
inline

Initializes a new instance of xtd::basic_string 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 basic_string.

◆ basic_string() [71/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char16 str,
xtd::size  count,
const allocator_type allocator 
)
inline

Initializes a new instance of xtd::basic_string 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 basic_string.

◆ basic_string() [72/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char32 str,
xtd::size  count,
const allocator_type allocator 
)
inline

Initializes a new instance of xtd::basic_string 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 basic_string.

◆ basic_string() [73/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::char8 str,
xtd::size  count,
const allocator_type allocator 
)
inline

Initializes a new instance of xtd::basic_string 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 basic_string.

◆ basic_string() [74/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const xtd::wchar str,
xtd::size  count,
const allocator_type allocator 
)
inline

Initializes a new instance of xtd::basic_string 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 basic_string.

◆ basic_string() [75/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const std::basic_string< char > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string() [76/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const std::basic_string< xtd::char16 > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string() [77/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const std::basic_string< xtd::char32 > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string() [78/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const std::basic_string< xtd::char8 > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string() [79/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const std::basic_string< xtd::wchar > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string() [80/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const std::basic_string< char > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string() [81/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const std::basic_string< xtd::char16 > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string() [82/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const std::basic_string< xtd::char32 > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string() [83/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const std::basic_string< xtd::char8 > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string() [84/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const std::basic_string< xtd::wchar > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string() [85/100]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename input_iterator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( input_iterator_t  first,
input_iterator_t  last 
)
inline

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

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

◆ basic_string() [86/100]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename input_iterator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( input_iterator_t  first,
input_iterator_t  last,
const allocator_type allocator 
)
inline

Initializes a new instance of xtd::basic_string 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 basic_string.

◆ basic_string() [87/100]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename string_view_like_t >
constexpr xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const string_view_like_t &  string_view)
inlineexplicitconstexpr

Initializes a new instance of xtd::basic_string with specified string view of substring and allocator.

Parameters
string_viewThe basic_string view.
allocatorThe allocator to use for all memory allocations of this basic_string.

◆ basic_string() [88/100]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename string_view_like_t >
constexpr xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const string_view_like_t &  string_view,
const allocator_type allocator 
)
inlineexplicitconstexpr

Initializes a new instance of xtd::basic_string with specified string view of substring and allocator.

Parameters
string_viewThe basic_string view.
allocatorThe allocator to use for all memory allocations of this basic_string.

◆ basic_string() [89/100]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename string_view_like_t >
constexpr xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const string_view_like_t &  string_view,
size_type  index,
size_type  count 
)
inlineconstexpr

Initializes a new instance of xtd::basic_string with specified string view of substring and allocator.

Parameters
string_viewThe basic_string view.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
allocatorThe allocator to use for all memory allocations of this basic_string.

◆ basic_string() [90/100]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename string_view_like_t >
constexpr xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( const string_view_like_t &  string_view,
size_type  index,
size_type  count,
const allocator_type allocator 
)
inlineconstexpr

Initializes a new instance of xtd::basic_string with specified string view of substring and allocator.

Parameters
string_viewThe basic_string view.
indexThe index of the first substring character where start copy.
countThe number of substring characters to copy.
allocatorThe allocator to use for all memory allocations of this basic_string.

◆ basic_string() [91/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( std::initializer_list< char >  il)
inline

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

Parameters
ilThe initializer list to fill.

◆ basic_string() [92/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( std::initializer_list< xtd::char16 il)
inline

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

Parameters
ilThe initializer list to fill.

◆ basic_string() [93/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( std::initializer_list< xtd::char32 il)
inline

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

Parameters
ilThe initializer list to fill.

◆ basic_string() [94/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( std::initializer_list< xtd::char8 il)
inline

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

Parameters
ilThe initializer list to fill.

◆ basic_string() [95/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( std::initializer_list< xtd::wchar il)
inline

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

Parameters
ilThe initializer list to fill.

◆ basic_string() [96/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( std::initializer_list< char >  il,
const allocator_type allocator 
)
inline

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

Parameters
ilThe initializer list to fill.
allocatorThe allocator to use for all memory allocations of this basic_string.

◆ basic_string() [97/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( std::initializer_list< xtd::char16 il,
const allocator_type allocator 
)
inline

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

Parameters
ilThe initializer list to fill.
allocatorThe allocator to use for all memory allocations of this basic_string.

◆ basic_string() [98/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( std::initializer_list< xtd::char32 il,
const allocator_type allocator 
)
inline

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

Parameters
ilThe initializer list to fill.
allocatorThe allocator to use for all memory allocations of this basic_string.

◆ basic_string() [99/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( std::initializer_list< xtd::char8 il,
const allocator_type allocator 
)
inline

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

Parameters
ilThe initializer list to fill.
allocatorThe allocator to use for all memory allocations of this basic_string.

◆ basic_string() [100/100]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::basic_string ( std::initializer_list< xtd::wchar il,
const allocator_type allocator 
)
inline

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

Parameters
ilThe initializer list to fill.
allocatorThe allocator to use for all memory allocations of this basic_string.

Member Function Documentation

◆ back()

template<typename char_t , typename traits_t , typename allocator_t >
const_reference xtd::basic_string< char_t, traits_t, allocator_t >::back ( ) const
inline

Returns reference to the last character in the string.

Returns
Reference to the last character, equivalent to operator[](size() - 1).
Exceptions
xtd::index_out_of_range_exceptionIf is empty.

◆ begin()

template<typename char_t , typename traits_t , typename allocator_t >
const_iterator xtd::basic_string< char_t, traits_t, allocator_t >::begin ( ) const
inlineoverridevirtual

Returns an iterator to the first character of the string.

Returns
Iterator to the first character.

Reimplemented from xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >.

◆ c_str()

template<typename char_t , typename traits_t , typename allocator_t >
const_pointer xtd::basic_string< char_t, traits_t, allocator_t >::c_str ( ) const
inlinenoexcept

Returns a pointer to a null-terminated character array with data equivalent to those stored in the string.

Returns
Pointer to the underlying character storage.
Remarks
The pointer is such that the range [c_str(), c_str() + size()] is valid and the values in it correspond to the values stored in the string with an additional null character after the last position.
The pointer obtained from c_str() may be invalidated by:
Writing to the character array accessed through c_str() is undefined behavior.
c_str() and data() perform the same function.

◆ capacity()

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::capacity ( ) const
inlinenoexcept

Returns the number of characters that the string has currently allocated space for.

Returns
Capacity of the currently allocated storage, i.e. the storage available for storing elements.

◆ cbegin()

template<typename char_t , typename traits_t , typename allocator_t >
const_iterator xtd::basic_string< char_t, traits_t, allocator_t >::cbegin ( ) const
inlineoverridevirtual

Returns an iterator to the first character of the string.

Returns
Iterator to the first character.

Reimplemented from xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >.

◆ crbegin()

template<typename char_t , typename traits_t , typename allocator_t >
const_reverse_iterator xtd::basic_string< char_t, traits_t, allocator_t >::crbegin ( ) const
inline

Returns a reverse iterator to the first character of the string.

Returns
Reverse iterator to the first character.

◆ chars()

template<typename char_t , typename traits_t , typename allocator_t >
const base_type & xtd::basic_string< char_t, traits_t, allocator_t >::chars ( ) const
inlinenoexcept

Returns a reference to the underlying base type.

Returns
Reference to the underlying base type.

◆ cend()

template<typename char_t , typename traits_t , typename allocator_t >
const_iterator xtd::basic_string< char_t, traits_t, allocator_t >::cend ( ) const
inlineoverridevirtual

Returns an iterator to the character following the last character of the string. This character acts as a placeholder, attempting to access it results in undefined behavior.

Returns
Iterator to the character following the last character.

Reimplemented from xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >.

◆ crend()

template<typename char_t , typename traits_t , typename allocator_t >
const_reverse_iterator xtd::basic_string< char_t, traits_t, allocator_t >::crend ( ) const
inline

Returns a reverse iterator to the character following the last character of the string. This character acts as a placeholder, attempting to access it results in undefined behavior.

Returns
Return iterator to the character following the last character.

◆ data()

template<typename char_t , typename traits_t , typename allocator_t >
const_pointer xtd::basic_string< char_t, traits_t, allocator_t >::data ( ) const
inlinenoexcept

Returns a pointer to the underlying array serving as character storage. The pointer is such that the range [data(), data() + size()] is valid and the values in it correspond to the values stored in the string.

Returns
A pointer to the underlying character storage.
Remarks
The pointer obtained from data() may be invalidated by:
  • Passing a non-const reference to the string to any standard library function, or
  • Calling non-const member functions on the string, excluding operator[](), at(), front(), back(), begin(), end(), rbegin(), rend().
    1. Modifying the character array accessed through the const overload of data has undefined behavior.
    2. Modifying the past-the-end null terminator stored at data() + size() to any value other than char_t() has undefined behavior.

◆ empty()

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::empty ( ) const
inlinenoexcept

Checks if the string has no characters, i.e. whether begin() == end().

Returns
true if the string is empty; otherwise false.
Examples
test_forms.cpp.

◆ end()

template<typename char_t , typename traits_t , typename allocator_t >
const_iterator xtd::basic_string< char_t, traits_t, allocator_t >::end ( ) const
inlineoverridevirtual

Returns an iterator to the character following the last character of the string. This character acts as a placeholder, attempting to access it results in undefined behavior.

Returns
Iterator to the character following the last character.

Reimplemented from xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >.

◆ front()

template<typename char_t , typename traits_t , typename allocator_t >
const_reference xtd::basic_string< char_t, traits_t, allocator_t >::front ( ) const
inline

Returns reference to the first character in the string. The behavior is undefined if empty() is true.

Returns
Reference to the first character, equivalent to operator[](0).
Exceptions
xtd::index_out_of_range_exceptionIf is empty.

◆ length()

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::length ( ) const
inlinenoexcept

Gets the number of characters in the current xtd::basic_string object.

Returns
The number of characters in the current string.
Remarks
The xtd::basic_string::length property returns the number of xtd::basic_string::value_type objects in this instance, not the number of Unicode characters. The reason is that a Unicode character might be represented by more than one xtd::basic_string::value_type.

◆ max_size()

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::max_size ( ) const
inlinenoexcept

Returns the maximum number of elements the string is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest string.

Returns
Maximum number of characters.

◆ rbegin()

template<typename char_t , typename traits_t , typename allocator_t >
const_reverse_iterator xtd::basic_string< char_t, traits_t, allocator_t >::rbegin ( ) const
inline

Returns a reverse iterator to the first character of the string.

Returns
Reverse iterator to the first character.

◆ rend()

template<typename char_t , typename traits_t , typename allocator_t >
const_reverse_iterator xtd::basic_string< char_t, traits_t, allocator_t >::rend ( ) const
inline

Returns a reverse iterator to the character following the last character of the string. This character acts as a placeholder, attempting to access it results in undefined behavior.

Returns
Return iterator to the character following the last character.

◆ size()

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::size ( ) const
inlinenoexcept

Returns the number of char_t elements in the string, i.e. std::distance(begin(), end()).

Returns
The number of char_t elements in the string.

◆ at()

template<typename char_t , typename traits_t , typename allocator_t >
const_reference xtd::basic_string< char_t, traits_t, allocator_t >::at ( size_type  pos) const
inline

Returns a reference to the character at specified location pos.

Returns
Reference to the requested character.
Exceptions
xtd::index_out_of_range_exceptionIf `index` is not within the range of the string.

◆ compare() [1/13]

template<typename char_t , typename traits_t , typename allocator_t >
int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( const basic_string< char_t, traits_t, allocator_t > &  str) const
inline

Compares two character sequences.

Parameters
strThe other string to compare to.
Returns
  • Negative value if *this appears before the character sequence specified by the arguments, in lexicographical order.
  • Zero if both character sequences compare equivalent.
  • Positive value if *this appears after the character sequence specified by the arguments, in lexicographical order.
Remarks
Compares this string to str.
A character sequence consisting of count1 characters starting at data1 is compared to a character sequence consisting of count2 characters starting at data2 as follows:
  • First, calculate the number of characters to compare, as if by size_type rlen = std::min(count1, count2).
  • Then compare the sequences by calling 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

◆ compare() [2/13]

template<typename char_t , typename traits_t , typename allocator_t >
int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( size_type  pos1,
size_type  count1,
const basic_string< char_t, traits_t, allocator_t > &  str 
) const
inline

Compares two character sequences.

Parameters
pos1The position of the first character in this string to compare.
count1The number of characters of this string to compare.
strThe other string to compare to.
Returns
  • Negative value if *this appears before the character sequence specified by the arguments, in lexicographical order.
  • Zero if both character sequences compare equivalent.
  • Positive value if *this appears after the character sequence specified by the arguments, in lexicographical order.
Remarks
Compares a [pos1, pos1 + count1) substring of this string to str.
  • If count1 > size() - pos1, the substring is [pos1, size()).
A character sequence consisting of count1 characters starting at data1 is compared to a character sequence consisting of count2 characters starting at data2 as follows:
  • First, calculate the number of characters to compare, as if by size_type rlen = std::min(count1, count2).
  • Then compare the sequences by calling 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

◆ compare() [3/13]

template<typename char_t , typename traits_t , typename allocator_t >
int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( size_type  pos1,
size_type  count1,
const basic_string< char_t, traits_t, allocator_t > &  str,
size_type  pos2 
) const
inline

Compares two character sequences.

Parameters
pos1The position of the first character in this string to compare.
count1The number of characters of this string to compare.
strThe other string to compare to.
pos2The position of the first character of the given string to compare.
Returns
  • Negative value if *this appears before the character sequence specified by the arguments, in lexicographical order.
  • Zero if both character sequences compare equivalent.
  • Positive value if *this appears after the character sequence specified by the arguments, in lexicographical order.
Remarks
Compares a [pos1, pos1 + count1) substring of this string to a substring [pos2, pos2 + count2) of str.
  • If count1 > size() - pos1, the first substring is [pos1, size()).
  • If count2 > str.size() - pos2, the second substring is [pos2, str.size()).
A character sequence consisting of count1 characters starting at data1 is compared to a character sequence consisting of count2 characters starting at data2 as follows:
  • First, calculate the number of characters to compare, as if by size_type rlen = std::min(count1, count2).
  • Then compare the sequences by calling 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

◆ compare() [4/13]

template<typename char_t , typename traits_t , typename allocator_t >
int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( size_type  pos1,
size_type  count1,
const basic_string< char_t, traits_t, allocator_t > &  str,
size_type  pos2,
size_type  count2 
) const
inline

Compares two character sequences.

Parameters
pos1The position of the first character in this string to compare.
count1The number of characters of this string to compare.
strThe other string to compare to.
pos2The position of the first character of the given string to compare.
count2The number of characters of the given string to compare.
Returns
A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter:
  • Negative value if *this appears before the character sequence specified by the arguments, in lexicographical order.
  • Zero if both character sequences compare equivalent.
  • Positive value if *this appears after the character sequence specified by the arguments, in lexicographical order.
Remarks
Compares a [pos1, pos1 + count1) substring of this string to a substring [pos2, pos2 + count2) of str.
  • If count1 > size() - pos1, the first substring is [pos1, size()).
  • If count2 > str.size() - pos2, the second substring is [pos2, str.size()).
A character sequence consisting of count1 characters starting at data1 is compared to a character sequence consisting of count2 characters starting at data2 as follows:
  • First, calculate the number of characters to compare, as if by size_type rlen = std::min(count1, count2).
  • Then compare the sequences by calling 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

◆ compare() [5/13]

template<typename char_t , typename traits_t , typename allocator_t >
int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( const_pointer  s) const
inline

Compares two character sequences.

Parameters
spointer to the character string to compare to.
Returns
  • Negative value if *this appears before the character sequence specified by the arguments, in lexicographical order.
  • Zero if both character sequences compare equivalent.
  • Positive value if *this appears after the character sequence specified by the arguments, in lexicographical order.
Remarks
Compares this string to the null-terminated character sequence beginning at the character pointed to by s with length traits_t::length(s).
A character sequence consisting of count1 characters starting at data1 is compared to a character sequence consisting of count2 characters starting at data2 as follows:
  • First, calculate the number of characters to compare, as if by size_type rlen = std::min(count1, count2).
  • Then compare the sequences by calling 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

◆ compare() [6/13]

template<typename char_t , typename traits_t , typename allocator_t >
int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( size_type  pos1,
size_type  count1,
const_pointer  s 
) const
inline

Compares two character sequences.

Parameters
pos1The position of the first character in this string to compare.
count1The number of characters of this string to compare.
spointer to the character string to compare to.
Returns
  • Negative value if *this appears before the character sequence specified by the arguments, in lexicographical order.
  • Zero if both character sequences compare equivalent.
  • Positive value if *this appears after the character sequence specified by the arguments, in lexicographical order.
Remarks
Compares a [pos1, pos1 + count1) substring of this string to the null-terminated character sequence beginning at the character pointed to by s with length traits_t::length(s).
  • If count1 > size() - pos1, the substring is [pos1$ , size()). @remarks A character sequence consisting ofcount1characters starting atdata1is compared to a character sequence consisting ofcount2characters starting atdata2as follows:
  • First, calculate the number of characters to compare, as if bysize_type rlen = std::min(count1, count2).
  • Then compare the sequences by callingtraits_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

◆ compare() [7/13]

template<typename char_t , typename traits_t , typename allocator_t >
int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( size_type  pos1,
size_type  count1,
const_pointer  s,
size_type  count2 
) const
inline

Compares two character sequences.

Parameters
pos1The position of the first character in this string to compare.
count1The number of characters of this string to compare.
spointer to the character string to compare to.
count2The number of characters of the given string to compare.
Returns
  • Negative value if *this appears before the character sequence specified by the arguments, in lexicographical order.
  • Zero if both character sequences compare equivalent.
  • Positive value if *this appears after the character sequence specified by the arguments, in lexicographical order.
Remarks
Compares a [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.
  • If count1 > size() - pos1, the substring is [pos1, size()).
A character sequence consisting of count1 characters starting at data1 is compared to a character sequence consisting of count2 characters starting at data2 as follows:
  • First, calculate the number of characters to compare, as if by size_type rlen = std::min(count1, count2).
  • Then compare the sequences by calling 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

◆ compare_to() [1/2]

template<typename char_t , typename traits_t , typename allocator_t >
int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare_to ( const object value) const
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.

Parameters
valueAn object that evaluates to a xtd::basic_string.
Returns
A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the 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.
Exceptions
xtd::argument_exception`value` is not a xtd::basic_string.

◆ compare_to() [2/2]

template<typename char_t , typename traits_t , typename allocator_t >
int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare_to ( const basic_string< char_t, traits_t, allocator_t > &  value) const
inlineoverridenoexcept

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.

Parameters
valueThe string to compare with this instance.
Returns
A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the 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.

◆ contains() [1/2]

template<typename char_t , typename traits_t , typename allocator_t >
virtual bool xtd::basic_string< char_t, traits_t, allocator_t >::contains ( value_type  value) const
inlinevirtualnoexcept

Returns a value indicating whether a specified char occurs within this basic_string.

Parameters
valueThe char to seek.
Returns
true if the value parameter occurs within this basic_string; otherwise, false.

◆ contains() [2/2]

template<typename char_t , typename traits_t , typename allocator_t >
virtual bool xtd::basic_string< char_t, traits_t, allocator_t >::contains ( const basic_string< char_t, traits_t, allocator_t > &  value) const
inlinevirtualnoexcept

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

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

◆ equals() [1/7]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::equals ( const object obj) const
inlineoverridevirtualnoexcept

Determines whether this instance and a specified object, which must also be a xtd::basic_string object, have the same value.

Parameters
objThe basic_string to compare to this instance.
Returns
true if obj is a xtd::basic_string and its value is the same as this instance; otherwise, false.

Reimplemented from xtd::object.

◆ equals() [2/7]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::equals ( const basic_string< char_t, traits_t, allocator_t > &  value) const
inlineoverridenoexcept

Determines whether this instance and another specified xtd::basic_string object have the same value.

Parameters
valueThe basic_string to compare to this instance.
Returns
true if the value of the value parameter is the same as the value of this instance; otherwise, false.
Remarks
This method performs an ordinal (case-sensitive) comparison.

◆ equals() [3/7]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::equals ( const basic_string< char_t, traits_t, allocator_t > &  value,
bool  ignore_case 
) const
inlinenoexcept

Determines whether this instance and another specified xtd::basic_string object have the same value, ignoring or honoring their case.

Parameters
valueThe basic_string to compare to this instance.
ignore_casetrue to ignore case when comparing this instance and value; otherwise, false
Returns
true if the value of the value parameter is the same as the value of this instance; otherwise, false.
Remarks
This method performs an ordinal comparison.

◆ ends_with() [1/5]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::ends_with ( value_type  value) const
inlinenoexcept

Determines whether the end of this basic_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]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::ends_with ( value_type  value,
bool  ignore_case 
) const
inlinenoexcept

Determines whether the end of this basic_string matches the specified character, ignoring or honoring their case.

Parameters
valueThe char_t to compare to the substring at the end of this instance.
ignore_casetrue to ignore case during the comparison; otherwise, false.
Returns
true if value matches the end of this instance; otherwise, false.

◆ ends_with() [3/5]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::ends_with ( const basic_string< char_t, traits_t, allocator_t > &  value) const
inlinenoexcept

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

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

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::ends_with ( const basic_string< char_t, traits_t, allocator_t > &  value,
bool  ignore_case 
) const
inlinenoexcept

Determines whether the end of this basic_string instance matches the specified basic_string, ignoring or honoring their case.

Parameters
valueThe string to compare to the substring at the end of this instance.
ignore_casetrue to ignore case during the comparison; otherwise, false.
Returns
bool true if value matches the end of the specified basic_string; otherwise, false.

◆ ends_with() [5/5]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::ends_with ( const basic_string< char_t, traits_t, allocator_t > &  value,
xtd::string_comparison  comparison_type 
) const
inlinenoexcept

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

Parameters
valueThe string to compare to the substring at the end of this instance.
comparison_typeOne of the enumeration values that determines how this basic_string and value are compared.
Returns
bool true if value matches the end of the specified basic_string; otherwise, false.

◆ find() [1/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find ( const basic_string< char_t, traits_t, allocator_t > &  str) const
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.

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

◆ find() [2/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find ( const basic_string< char_t, traits_t, allocator_t > &  str,
size_type  pos 
) const
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.

Parameters
strThe string to search for.
posThe position at which to start the search
Returns
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.

◆ find() [3/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find ( const_pointer  s,
size_type  pos,
size_type  count 
) const
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.

Parameters
strThe string to search for.
posThe position at which to start the search
countThe length of substring to search for.
Returns
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).
This range may contain null characters. If [s, s + count) is not a valid range, the behavior is undefined.

◆ find() [4/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find ( const_pointer  s) const
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.

Parameters
sThe pointer to a character string to search for.
Returns
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 character string pointed to by s. The length of the string is determined by the first null character using traits_t::length(s).
If [s, s + traits_t::length(s)) is not a valid range, the behavior is undefined.

◆ find() [5/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find ( const_pointer  s,
size_type  pos 
) const
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.

Parameters
sThe pointer to a character string to search for.
posThe position at which to start the search
Returns
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 character string pointed to by s. The length of the string is determined by the first null character using traits_t::length(s).
If [s, s + traits_t::length(s)) is not a valid range, the behavior is undefined.

◆ find() [6/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find ( value_type  ch) const
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.

Parameters
chThe character to search for.
Returns
Position of the first character of the found substring or xtd::basic_string::npos if no such substring is found.
Remarks
Finds the first character ch (treated as a single-character substring by the formal rules below).

◆ find() [7/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find ( value_type  ch,
size_type  pos 
) const
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.

Parameters
chThe character to search for.
posThe position at which to start the search
Returns
Position of the first character of the found substring or xtd::basic_string::npos if no such substring is found.
Remarks
Finds the first character ch (treated as a single-character substring by the formal rules below).

◆ find_first_of() [1/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_of ( const basic_string< char_t, traits_t, allocator_t > &  str) const
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.

Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in str.

◆ find_first_of() [2/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_of ( const basic_string< char_t, traits_t, allocator_t > &  str,
size_type  pos 
) const
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.

Parameters
strThe string identifying characters to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in str.

◆ find_first_of() [3/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_of ( const_pointer  s,
size_type  pos,
size_type  count 
) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
posThe position at which to begin searching.
countThe length of character string identifying characters to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in the range [s, s + count). This range can include null characters.
If [s, s + count) is not a valid range, the behavior is undefined.

◆ find_first_of() [4/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_of ( const_pointer  s) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in character string pointed to by s. The length of the string is determined by the first null character using traits_t::length(s).
If [s, s + traits_t::length(s)) is not a valid range, the behavior is undefined.

◆ find_first_of() [5/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_of ( const_pointer  s,
size_type  pos 
) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in character string pointed to by s. The length of the string is determined by the first null character using traits_t::length(s).
If [s, s + traits_t::length(s)) is not a valid range, the behavior is undefined.

◆ find_first_of() [6/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_of ( char_t  ch) const
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.

Parameters
chThe character to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to ch.

◆ find_first_of() [7/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_of ( char_t  ch,
size_type  pos 
) const
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.

Parameters
chThe character to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to ch.

◆ find_first_not_of() [1/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_not_of ( const basic_string< char_t, traits_t, allocator_t > &  str) const
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.

Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in str.

◆ find_first_not_of() [2/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_not_of ( const basic_string< char_t, traits_t, allocator_t > &  str,
size_type  pos 
) const
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.

Parameters
strThe string identifying characters to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in str.

◆ find_first_not_of() [3/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_not_of ( const_pointer  s,
size_type  pos,
size_type  count 
) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
posThe position at which to begin searching.
countThe length of character string identifying characters to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in the range [s, s + count). This range can include null characters.
If [s, s + count) is not a valid range, the behavior is undefined.

◆ find_first_not_of() [4/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_not_of ( const_pointer  s) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in character string pointed to by s. The length of the string is determined by the first null character using traits_t::length(s).
If [s, s + traits_t::length(s)) is not a valid range, the behavior is undefined.

◆ find_first_not_of() [5/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_not_of ( const_pointer  s,
size_type  pos 
) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in character string pointed to by s. The length of the string is determined by the first null character using traits_t::length(s).
If [s, s + traits_t::length(s)) is not a valid range, the behavior is undefined.

◆ find_first_not_of() [6/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_not_of ( char_t  ch) const
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.

Parameters
chThe character to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to ch.

◆ find_first_not_of() [7/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_first_not_of ( char_t  ch,
size_type  pos 
) const
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.

Parameters
chThe character to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to ch.

◆ find_last_of() [1/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_of ( const basic_string< char_t, traits_t, allocator_t > &  str) const
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.

Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in str.

◆ find_last_of() [2/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_of ( const basic_string< char_t, traits_t, allocator_t > &  str,
size_type  pos 
) const
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.

Parameters
strThe string identifying characters to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in str.

◆ find_last_of() [3/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_of ( const_pointer  s,
size_type  pos,
size_type  count 
) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
posThe position at which to begin searching.
countThe length of character string identifying characters to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in the range [s, s + count). This range can include null characters.
If [s, s + count) is not a valid range, the behavior is undefined.

◆ find_last_of() [4/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_of ( const_pointer  s) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in character string pointed to by s. The length of the string is determined by the first null character using traits_t::length(s).
If [s, s + traits_t::length(s)) is not a valid range, the behavior is undefined.

◆ find_last_of() [5/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_of ( const_pointer  s,
size_type  pos 
) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in character string pointed to by s. The length of the string is determined by the first null character using traits_t::length(s).
If [s, s + traits_t::length(s)) is not a valid range, the behavior is undefined.

◆ find_last_of() [6/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_of ( char_t  ch) const
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.

Parameters
chThe character to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to ch.

◆ find_last_of() [7/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_of ( char_t  ch,
size_type  pos 
) const
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.

Parameters
chThe character to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to ch.

◆ find_last_not_of() [1/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_not_of ( const basic_string< char_t, traits_t, allocator_t > &  str) const
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.

Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in str.

◆ find_last_not_of() [2/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_not_of ( const basic_string< char_t, traits_t, allocator_t > &  str,
size_type  pos 
) const
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.

Parameters
strThe string identifying characters to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in str.

◆ find_last_not_of() [3/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_not_of ( const_pointer  s,
size_type  pos,
size_type  count 
) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
posThe position at which to begin searching.
countThe length of character string identifying characters to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in the range [s, s + count). This range can include null characters.
If [s, s + count) is not a valid range, the behavior is undefined.

◆ find_last_not_of() [4/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_not_of ( const_pointer  s) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in character string pointed to by s. The length of the string is determined by the first null character using traits_t::length(s).
If [s, s + traits_t::length(s)) is not a valid range, the behavior is undefined.

◆ find_last_not_of() [5/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_not_of ( const_pointer  s,
size_type  pos 
) const
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.

Parameters
sThe pointer to a character string identifying characters to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to one of the characters in character string pointed to by s. The length of the string is determined by the first null character using traits_t::length(s).
If [s, s + traits_t::length(s)) is not a valid range, the behavior is undefined.

◆ find_last_not_of() [6/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_not_of ( char_t  ch) const
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.

Parameters
chThe character to search for.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to ch.

◆ find_last_not_of() [7/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::find_last_not_of ( char_t  ch,
size_type  pos 
) const
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.

Parameters
chThe character to search for.
posThe position at which to begin searching.
Returns
Position of the found character or xtd::basic_string::npos if no such character is found.
Remarks
Finds the first character equal to ch.

◆ get_allocator()

template<typename char_t , typename traits_t , typename allocator_t >
allocator_type xtd::basic_string< char_t, traits_t, allocator_t >::get_allocator ( ) const
inline

Returns the allocator associated with the string.

Returns
The associated allocator.

◆ get_base_type()

template<typename char_t , typename traits_t , typename allocator_t >
virtual const base_type & xtd::basic_string< char_t, traits_t, allocator_t >::get_base_type ( ) const
inlinevirtualnoexcept

Returns the underlying base type.

Returns
The underlying base type.

◆ get_hash_code()

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::get_hash_code ( ) const
inlineoverridevirtualnoexcept

Returns the hash code for this basic_string.

Returns
A hash code.

Reimplemented from xtd::object.

◆ get_enumerator()

template<typename char_t , typename traits_t , typename allocator_t >
enumerator_type xtd::basic_string< char_t, traits_t, allocator_t >::get_enumerator ( ) const
inlineoverridevirtualnoexcept

Returns an enumerator that iterates through a collection.

Returns
An xtd::collections::generic::enumerator object that can be used to iterate through the collection.

Implements xtd::collections::generic::ienumerable< char_t >.

◆ index_of() [1/6]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::index_of ( const basic_string< char_t, traits_t, allocator_t > &  value) const
inlinenoexcept

Reports the index of the first occurrence of the specified basic_string in this basic_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.
Examples
time_span_from_hours.cpp.

◆ index_of() [2/6]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::index_of ( const basic_string< char_t, traits_t, allocator_t > &  value,
xtd::size  start_index 
) const
inline

Reports the index of the first occurrence of the specified character in this basic_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() [3/6]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::index_of ( const basic_string< char_t, traits_t, allocator_t > &  value,
xtd::size  start_index,
xtd::size  count 
) const
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.

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.
Exceptions
xtd::index_out_of_range_exceptionstart_index + count are greater than the length of this instance.

◆ index_of() [4/6]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::index_of ( value_type  value) const
inlinenoexcept

Reports the index of the first occurrence of the specified character in this basic_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() [5/6]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::index_of ( value_type  value,
xtd::size  start_index 
) const
inline

Reports the index of the first occurrence of the specified character in this basic_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() [6/6]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::index_of ( value_type  value,
xtd::size  start_index,
xtd::size  count 
) const
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.

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.
Exceptions
xtd::index_out_of_range_exceptionstart_index + count are greater than the length of this instance.

◆ index_of_any() [1/3]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::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.

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]

template<typename char_t , typename traits_t , typename allocator_t >
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.

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.
Exceptions
xtd::index_out_of_range_exceptionstart_index + count are greater than the length of this instance.

◆ index_of_any() [3/3]

template<typename char_t , typename traits_t , typename allocator_t >
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.

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.
Exceptions
xtd::index_out_of_range_exceptionstart_index + count are greater than the length of this instance.

◆ insert()

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::insert ( xtd::size  start_index,
const basic_string< char_t, traits_t, allocator_t > &  value 
) const
inline

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

Parameters
start_indexThe index position of the insertion.
valueThe basic_string to insert.
Returns
A new basic_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() [1/2]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::is_empty ( ) const
inlinenoexcept

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

Returns
true if the value parameter is null or an empty basic_string (""); otherwise, false.
Deprecated:
Replaced by xtd::basic_string::is_empty(const xtd::basic_string&) - Will be removed in version 0.4.0.

◆ last_index_of() [1/6]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::last_index_of ( const basic_string< char_t, traits_t, allocator_t > &  value) const
inlinenoexcept

Reports the index of the last occurrence of the specified basic_string in this basic_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.
Examples
test_forms.cpp.

◆ last_index_of() [2/6]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::last_index_of ( const basic_string< char_t, traits_t, allocator_t > &  value,
xtd::size  start_index 
) const
inline

Reports the index of the last occurrence of the specified character in this basic_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.
Exceptions
xtd::index_out_of_range_exceptionstart_index + count are greater than the length of this instance.

◆ last_index_of() [3/6]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::last_index_of ( const basic_string< char_t, traits_t, allocator_t > &  value,
xtd::size  start_index,
xtd::size  count 
) const
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.

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.
Exceptions
xtd::index_out_of_range_exceptionstart_index + count are greater than the length of this instance.

◆ last_index_of() [4/6]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::last_index_of ( value_type  value) const
inlinenoexcept

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

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::last_index_of ( value_type  value,
xtd::size  start_index 
) const
inline

Reports the index of the last occurrence of the specified character in this basic_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.
Exceptions
xtd::index_out_of_range_exceptionstart_index + count are greater than the length of this instance.

◆ last_index_of() [6/6]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::last_index_of ( value_type  value,
xtd::size  start_index,
xtd::size  count 
) const
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.

Parameters
strA basic_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.
Exceptions
xtd::index_out_of_range_exceptionstart_index + count are greater than the length of this instance.

◆ last_index_of_any() [1/3]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::size xtd::basic_string< char_t, traits_t, allocator_t >::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.

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]

template<typename char_t , typename traits_t , typename allocator_t >
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.

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]

template<typename char_t , typename traits_t , typename allocator_t >
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.

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]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::pad_left ( xtd::size  total_width) const
inlinenoexcept

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

Parameters
total_widthThe number of characters in the resulting basic_string, equal to the number of original characters plus any additional padding characters.
Returns
A new basic_string that is equivalent to the specified basic_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 basic_string, a new basic_string object that is identical to the specified basic_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 basic_string. This means that, when used with right-to-left languages, it pads the right portion of the basic_string..

◆ pad_left() [2/2]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::pad_left ( xtd::size  total_width,
char32  padding_char 
) const
inlinenoexcept

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

Parameters
total_widthThe number of characters in the resulting basic_string, equal to the number of original characters plus any additional padding characters.
paddingCharAn unicode padding character.
Returns
A new basic_string that is equivalent to the specified basic_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 basic_string, a new basic_string object that is identical the specified basic_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 basic_string. This means that, when used with right-to-left languages, it pads the right portion of the basic_string..

◆ pad_right() [1/2]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::pad_right ( xtd::size  total_width) const
inlinenoexcept

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

Parameters
totalWidthThe number of characters in the resulting basic_string, equal to the number of original characters plus any additional padding characters.
Returns
A new basic_string that is equivalent to the specified basic_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 basic_string, a new basic_string object that is identical to the specified basic_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 basic_string. This means that, when used with right-to-left languages, it pads the left portion of the basic_string..

◆ pad_right() [2/2]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::pad_right ( xtd::size  total_width,
char32  padding_char 
) const
inlinenoexcept

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

Parameters
totalWidthThe number of characters in the resulting basic_string, equal to the number of original characters plus any additional padding characters.
paddingCharAn unicode padding character.
Returns
A new basic_string that is equivalent to the specified basic_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 basic_string, a new basic_string object that is identical to the specified basic_string.
Remarks
An unicode space is defined as hexadecimal 0x20.
The xtd::basic_string::pad_right method pads the end of the returned basic_string. This means that, when used with right-to-left languages, it pads the left portion of the basic_string..

◆ quoted() [1/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::quoted ( ) const
inline

Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML.

Returns
A new quoted basic_string.
Remarks
the delimiter is set to
" 
by default and the escape is set to \ by default.
for more information see std::quoted.

◆ quoted() [2/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::quoted ( value_type  delimiter) const
inline

Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified delimiter.

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

◆ quoted() [3/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::quoted ( value_type  delimiter,
value_type  escape 
) const
inline

Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified delimiter and escape.

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

◆ remove() [1/2]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::remove ( xtd::size  start_index) const
inline

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

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

◆ remove() [2/2]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::remove ( xtd::size  start_index,
xtd::size  count 
) const
inline

Deletes all the characters from this basic_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 basic_string object that is equivalent to this basic_string less the removed characters.

◆ replace() [1/2]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::replace ( value_type  old_char,
value_type  new_char 
) const
inlinenoexcept

Replaces all occurrences of a specified char_t in this basic_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 basic_string equivalent to the specified basic_string but with all instances of old_char replaced with new_char.
Examples
file_info_replace.cpp.

◆ replace() [2/2]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::replace ( const basic_string< char_t, traits_t, allocator_t > &  old_string,
const basic_string< char_t, traits_t, allocator_t > &  new_string 
) const
inlinenoexcept

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

Parameters
old_stringA basic_string to be replaced.
new_stringA basic_string to replace all occurrences of old_string.
Returns
A new basic_string equivalent to the specified basic_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

◆ rfind() [1/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::rfind ( const basic_string< char_t, traits_t, allocator_t > &  str) const
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 tostr`.

◆ rfind() [2/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::rfind ( const basic_string< char_t, traits_t, allocator_t > &  str,
size_type  pos 
) const
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.

Parameters
strThe string to search for.
posThe position at which to start the search
Returns
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.

◆ rfind() [3/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::rfind ( const_pointer  s,
size_type  pos,
size_type  count 
) const
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.

Parameters
strThe string to search for.
posThe position at which to start the search
countThe length of substring to search for.
Returns
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).
This range may contain null characters. If [s, s + count) is not a valid range, the behavior is undefined.

◆ rfind() [4/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::rfind ( const_pointer  s) const
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. @param s The pointer to a character string 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 character string pointed to bys. The length of the string is determined by the first null character usingtraits_t::length(s). @remarks If [s,s + traits_t::length(s)`) is not a valid range, the behavior is undefined.

◆ rfind() [5/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::rfind ( const_pointer  s,
size_type  pos 
) const
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.

Parameters
sThe pointer to a character string to search for.
posThe position at which to start the search
Returns
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 character string pointed to by s. The length of the string is determined by the first null character using traits_t::length(s).
If [s, s + traits_t::length(s)) is not a valid range, the behavior is undefined.

◆ rfind() [6/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::rfind ( value_type  ch) const
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. @param ch The character 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 characterch` (treated as a single-character substring by the formal rules below).

◆ rfind() [7/7]

template<typename char_t , typename traits_t , typename allocator_t >
size_type xtd::basic_string< char_t, traits_t, allocator_t >::rfind ( value_type  ch,
size_type  pos 
) const
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.

Parameters
chThe character to search for.
posThe position at which to start the search
Returns
Position of the first character of the found substring or xtd::basic_string::npos if no such substring is found.
Remarks
Finds the first character ch (treated as a single-character substring by the formal rules below).

◆ split() [1/9]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< basic_string > xtd::basic_string< char_t, traits_t, allocator_t >::split ( ) const
noexcept

Splits this basic_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 xtd::char_object::isspace() or std::iswspace() method.

Returns
An array whose elements contain the substrings in this basic_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 basic_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 basic_string.
Examples
split.cpp.

◆ split() [2/9]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< basic_string > xtd::basic_string< char_t, traits_t, allocator_t >::split ( value_type  separator) const
noexcept

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

Parameters
separatorA character that delimits the substrings in this basic_string.
Returns
An array whose elements contain the substrings in this basic_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 basic_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 basic_string.

◆ split() [3/9]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< basic_string > xtd::basic_string< char_t, traits_t, allocator_t >::split ( value_type  separator,
xtd::string_split_options  options 
) const
noexcept

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

Parameters
separatorA character that delimits the substrings in this basic_string
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 basic_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 basic_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 basic_string.
If the specified basic_string does not contain any of the characters in separator, the returned array consists of a single element that contains the specified basic_string.
If the options parameter is remove_empty_entries and the length of the specified basic_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 basic_string, the corresponding array element contains empty basic_string. For example, if separator includes two elements, "-" and "_", the value of the basic_string instance is "-_aa-_", and the value of the options argument is None, the method returns a basic_string array with the following five elements:
  1. empty basic_string, which represents the empty basic_string that precedes the "-" character at index 0.
  2. empty basic_string, which represents the empty basic_string between the "-" character at index 0 and the "_" character at index 1.
  3. "aa",
  4. empty basic_string, which represents the empty basic_string that follows the "_" character at index 4.
  5. empty basic_string, which represents the empty basic_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 xtd::char_object::isspace() or std::iswspace() method.
If count is greater than the number of substrings, the available substrings are returned.

◆ split() [4/9]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< basic_string > xtd::basic_string< char_t, traits_t, allocator_t >::split ( value_type  separator,
xtd::size  count 
) const
noexcept

Splits this basic_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
separatorA character array that delimits the substrings in this basic_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 basic_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 basic_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 basic_string, the corresponding array element contains empty basic_string.
If there are more than count substrings in the specified basic_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 basic_string are returned in the last element of the return value.

◆ split() [5/9]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< basic_string > xtd::basic_string< char_t, traits_t, allocator_t >::split ( value_type  separator,
xtd::size  count,
xtd::string_split_options  options 
) const
noexcept

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

Parameters
separatorsA character array that delimits the substrings in this basic_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 basic_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 basic_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 basic_string.
If the count parameter is zero, or the options parameter is remove_empty_entries and the length of the specified basic_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 basic_string, the corresponding array element contains an empty basic_string.
If there are more than count substrings in the specified basic_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 basic_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() [6/9]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< basic_string > xtd::basic_string< char_t, traits_t, allocator_t >::split ( const xtd::array< value_type > &  separators) const
noexcept

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

Parameters
separatorsA character array that delimits the substrings in this basic_string, an empty array that contains no delimiters.
Returns
An array whose elements contain the substrings in this basic_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 basic_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 basic_string.

◆ split() [7/9]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< basic_string > xtd::basic_string< char_t, traits_t, allocator_t >::split ( const xtd::array< value_type > &  separators,
xtd::string_split_options  options 
) const
noexcept

Splits this basic_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 basic_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 basic_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 basic_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 basic_string.
If the specified basic_string does not contain any of the characters in separator, the returned array consists of a single element that contains the specified basic_string.
If the options parameter is remove_empty_entries and the length of the specified basic_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 basic_string, the corresponding array element contains empty basic_string. For example, if separator includes two elements, "-" and "_", the value of the basic_string instance is "-_aa-_", and the value of the options argument is None, the method returns a basic_string array with the following five elements:
  1. empty basic_string, which represents the empty basic_string that precedes the "-" character at index 0.
  2. empty basic_string, which represents the empty basic_string between the "-" character at index 0 and the "_" character at index 1.
  3. "aa",
  4. empty basic_string, which represents the empty basic_string that follows the "_" character at index 4.
  5. empty basic_string, which represents the empty basic_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 xtd::char_object::isspace() or std::iswspace() method.
If count is greater than the number of substrings, the available substrings are returned.

◆ split() [8/9]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< basic_string > xtd::basic_string< char_t, traits_t, allocator_t >::split ( const xtd::array< value_type > &  separators,
xtd::size  count 
) const
noexcept

Splits this basic_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 basic_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 basic_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 basic_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 basic_string, the corresponding array element contains empty basic_string.
If there are more than count substrings in the specified basic_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 basic_string are returned in the last element of the return value.

◆ split() [9/9]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< basic_string > xtd::basic_string< char_t, traits_t, allocator_t >::split ( const xtd::array< value_type > &  separators,
xtd::size  count,
xtd::string_split_options  options 
) const
noexcept

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

Parameters
separatorsA character array that delimits the substrings in this basic_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 basic_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 basic_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 basic_string.
If the count parameter is zero, or the options parameter is remove_empty_entries and the length of the specified basic_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 basic_string, the corresponding array element contains an empty basic_string.
If there are more than count substrings in the specified basic_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 basic_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.

◆ starts_with() [1/5]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::starts_with ( value_type  value) const
inlinenoexcept

Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic_string.

Parameters
valueA xtd::basic_string to compare to.
Returns
bool true if value matches the beginning of the specified basic_string; otherwise, false.
Remarks
This method compares value to the substring at the beginning of the specified basic_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 basic_string.

◆ starts_with() [2/5]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::starts_with ( value_type  value,
bool  ignore_case 
) const
inlinenoexcept

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

Parameters
valueA xtd::basic_string to compare to.
ignore_casetrue to ignore case when comparing the specified basic_string and value; otherwise, false
Returns
bool true if value matches the beginning of the specified basic_string; otherwise, false.
Remarks
This method compares value to the substring at the beginning of the specified basic_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 basic_string.

◆ starts_with() [3/5]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::starts_with ( const basic_string< char_t, traits_t, allocator_t > &  value) const
inlinenoexcept

Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic_string.

Parameters
valueA xtd::basic_string to compare to.
Returns
bool true if value matches the beginning of the specified basic_string; otherwise, false.
Remarks
This method compares value to the substring at the beginning of the specified basic_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 basic_string.

◆ starts_with() [4/5]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::starts_with ( const basic_string< char_t, traits_t, allocator_t > &  value,
bool  ignore_case 
) const
inlinenoexcept

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

Parameters
valueA xtd::basic_string to compare to.
ignore_casetrue to ignore case when comparing the specified basic_string and value; otherwise, false
Returns
bool true if value matches the beginning of the specified basic_string; otherwise, false.
Remarks
This method compares value to the substring at the beginning of the specified basic_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 basic_string.

◆ starts_with() [5/5]

template<typename char_t , typename traits_t , typename allocator_t >
bool xtd::basic_string< char_t, traits_t, allocator_t >::starts_with ( const basic_string< char_t, traits_t, allocator_t > &  value,
xtd::string_comparison  comparison_type 
) const
inlinenoexcept

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

Parameters
valueThe string to compare to the substring at the end of this instance.
comparison_typeOne of the enumeration values that determines how this basic_string and value are compared.
Returns
bool true if value matches the end of the specified basic_string; otherwise, false.

◆ substr() [1/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::substr ( ) const
inline

Returns a substring [pos, pos + count). If the requested substring extends past the end of the string, i.e. the count is greater than size() - pos (e.g. if count == xtd::basic_string::npos), the returned substring is [pos, size()).

Returns
String containing the substring [pos, pos + count) or [pos, size()).
Exceptions
`std::out_of_range`if `pos > size()`.
Remarks
Equivalent to return basic_string(*this, pos, count);.

◆ substr() [2/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::substr ( size_type  pos) const
inline

Returns a substring [pos, pos + count). If the requested substring extends past the end of the string, i.e. the count is greater than size() - pos (e.g. if count == xtd::basic_string::npos), the returned substring is [pos, size()).

Parameters
posThe position of the first character to include.
Returns
String containing the substring [pos, pos + count) or [pos, size()).
Exceptions
`std::out_of_range`if `pos > size()`.
Remarks
Equivalent to return basic_string(*this, pos, count);.

◆ substr() [3/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::substr ( size_type  pos,
size_type  count 
) const
inline

Returns a substring [pos, pos + count). If the requested substring extends past the end of the string, i.e. the count is greater than size() - pos (e.g. if count == xtd::basic_string::npos), the returned substring is [pos, size()).

Parameters
posThe position of the first character to include.
countThe length of the substring.
Returns
String containing the substring [pos, pos + count) or [pos, size()).
Exceptions
`std::out_of_range`if `pos > size()`.
Remarks
Equivalent to return basic_string(*this, pos, count);.

◆ substring() [1/2]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::substring ( xtd::size  start_index) const
inline

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

Parameters
strbasic_string to substring.
start_indexThe zero-based starting character position of a substring in this instance.
Returns
A basic_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.
Exceptions
xtd::argument_out_of_range_exception`start_index` is greater than the length() of this instance.
Examples
test_forms.cpp.

◆ substring() [2/2]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::substring ( xtd::size  start_index,
xtd::size  length 
) const
inline

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 basic_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.
Exceptions
xtd::argument_out_of_range_exception`start_index` plus `length` is greater than the length() of this instance.

◆ to_array() [1/3]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< value_type > xtd::basic_string< char_t, traits_t, allocator_t >::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 xtd::basic_string, the returned array is empty and has a zero length.

◆ to_array() [2/3]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< value_type > xtd::basic_string< char_t, traits_t, allocator_t >::to_array ( xtd::size  start_index) const

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

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

◆ to_array() [3/3]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< value_type > xtd::basic_string< char_t, traits_t, allocator_t >::to_array ( xtd::size  start_index,
xtd::size  length 
) const

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

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

◆ to_char_array() [1/2]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< value_type > xtd::basic_string< char_t, traits_t, allocator_t >::to_char_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 xtd::basic_string, the returned array is empty and has a zero length.

◆ to_char_array() [2/2]

template<typename char_t , typename traits_t , typename allocator_t >
xtd::array< value_type > xtd::basic_string< char_t, traits_t, allocator_t >::to_char_array ( xtd::size  start_index,
xtd::size  length 
) const

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

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

◆ to_lower()

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::to_lower ( ) const
inlinenoexcept

Returns a copy of the current xtd::basic_string converted to lowercase.

Returns
A string in lowercase.

◆ to_string()

template<typename char_t , typename traits_t , typename allocator_t >
basic_string< char > xtd::basic_string< char_t, traits_t, allocator_t >::to_string ( ) const
inlineoverridevirtualnoexcept

Converts the value of this instance to a xtd::basic_string <char>.

Returns
The current string.
Todo:
Uncomment the folllowing line and remove the next..

Reimplemented from xtd::object.

◆ to_title_case()

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::to_title_case ( ) const
noexcept

Converts the current basic_string to title case (except for words that are entirely in uppercase, which are considered to be acronyms).

Returns
A new basic_string in title case.

◆ to_u16string()

template<typename char_t , typename traits_t , typename allocator_t >
basic_string< xtd::char16 > xtd::basic_string< char_t, traits_t, allocator_t >::to_u16string ( ) const
inlinenoexcept

Converts the value of this instance to a xtd::basic_string <xtd::char16>.

Returns
The current string.

◆ to_u32string()

template<typename char_t , typename traits_t , typename allocator_t >
basic_string< xtd::char32 > xtd::basic_string< char_t, traits_t, allocator_t >::to_u32string ( ) const
inlinenoexcept

Converts the value of this instance to a xtd::basic_string <xtd::char32>.

Returns
The current string.

◆ to_u8string()

template<typename char_t , typename traits_t , typename allocator_t >
basic_string< xtd::char8 > xtd::basic_string< char_t, traits_t, allocator_t >::to_u8string ( ) const
inlinenoexcept

Converts the value of this instance to a xtd::basic_string <xtd::char8>.

Returns
The current string.

◆ to_upper()

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::to_upper ( ) const
inlinenoexcept

Returns a copy of the current xtd::basic_string converted to uppercase.

Returns
A string in uppercase.

◆ to_wstring()

template<typename char_t , typename traits_t , typename allocator_t >
basic_string< xtd::wchar > xtd::basic_string< char_t, traits_t, allocator_t >::to_wstring ( ) const
inlinenoexcept

Converts the value of this instance to a xtd::basic_string <xtd::wchar>.

Returns
The current string.

◆ trim() [1/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::trim ( ) const
inlinenoexcept

Removes all leading and trailing occurrences of white-space characters from the specified xtd::basic_string.

Parameters
strxtd::basic_string to trim end.
trim_charA character to remove.
Returns
The xtd::basic_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 xtd::basic_string.

◆ trim() [2/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::trim ( value_type  trim_char) const
noexcept

Removes all leading and trailing occurrences of a character specified from the specified xtd::basic_string .

Parameters
strxtd::basic_string to trim start.
trim_charA character to remove.
Returns
The xtd::basic_string that remains after all occurrences of the character in the trim_char parameter are removed from the start and the end of the specified xtd::basic_string.

◆ trim() [3/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::trim ( const xtd::array< value_type > &  trim_chars) const
noexcept

Removes all leading and trailing occurrences of a set of characters specified in an array from the specified xtd::basic_string.

Parameters
strxtd::basic_string to trim end.
trim_charsAn array of characters to remove.
Returns
The xtd::basic_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 xtd::basic_string.

◆ trim_end() [1/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::trim_end ( ) const
inlinenoexcept

Removes all trailing occurrences of white-space characters from the specified xtd::basic_string.

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

◆ trim_end() [2/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::trim_end ( value_type  trim_char) const
noexcept

Removes all trailing occurrences of a character specified from the specified xtd::basic_string .

Parameters
strxtd::basic_string to trim start.
trim_charA character to remove.
Returns
The xtd::basic_string that remains after all occurrences of the character in the trim_char parameter are removed from the end of the specified xtd::basic_string.

◆ trim_end() [3/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::trim_end ( const xtd::array< value_type > &  trim_chars) const
noexcept

Removes all trailing occurrences of a set of characters specified in an array from the specified xtd::basic_string.

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

◆ trim_start() [1/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::trim_start ( ) const
inlinenoexcept

Removes all leading occurrences of white-space characters from the specified xtd::basic_string.

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

◆ trim_start() [2/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::trim_start ( value_type  trim_char) const
noexcept

Removes all leading occurrences of a character specified from the specified xtd::basic_string .

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

◆ trim_start() [3/3]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string xtd::basic_string< char_t, traits_t, allocator_t >::trim_start ( const xtd::array< value_type > &  trim_chars) const
noexcept

Removes all leading occurrences of a set of characters specified in an array from the specified xtd::basic_string.

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

◆ class_name() [1/3]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename object_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::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 basic_string type is basic_string.
Deprecated:
Replaced by typeof_<object_t>().name() - Will be removed in version 0.4.0.

◆ class_name() [2/3]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename object_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::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 basic_string type is basic_string.
Deprecated:
Replaced by typeof_(object).name() - Will be removed in version 0.4.0.

◆ class_name() [3/3]

template<typename char_t , typename traits_t , typename allocator_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::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 basic_string type is basic_string.
Deprecated:
Replaced by typeof_(info).name() - Will be removed in version 0.4.0.

◆ compare() [8/13]

template<typename char_t , typename traits_t , typename allocator_t >
static int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( const basic_string< char_t, traits_t, allocator_t > &  str_a,
const basic_string< char_t, traits_t, allocator_t > &  str_b 
)
inlinestaticnoexcept

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

Parameters
str_aThe first basic_string to compare.
str_bThe second basic_string to compare.
Returns
A 32-bit signed integer that indicates the lexical relationship between the two compares.
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() [9/13]

template<typename char_t , typename traits_t , typename allocator_t >
static int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( const basic_string< char_t, traits_t, allocator_t > &  str_a,
const basic_string< char_t, traits_t, allocator_t > &  str_b,
bool  ignore_case 
)
inlinestaticnoexcept

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

Parameters
str_aThe first basic_string to compare.
str_bThe second basic_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 compares.
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() [10/13]

template<typename char_t , typename traits_t , typename allocator_t >
static int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( const basic_string< char_t, traits_t, allocator_t > &  str_a,
const basic_string< char_t, traits_t, allocator_t > &  str_b,
xtd::string_comparison  comparison_type 
)
inlinestaticnoexcept

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

Parameters
str_aThe first basic_string to compare.
str_bThe second basic_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 compares.
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() [11/13]

template<typename char_t , typename traits_t , typename allocator_t >
static int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( const basic_string< char_t, traits_t, allocator_t > &  str_a,
xtd::size  index_a,
const basic_string< char_t, traits_t, allocator_t > &  str_b,
xtd::size  index_b,
xtd::size  length 
)
inlinestatic

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

Parameters
str_aThe first basic_string to use in the comparison.
index_aThe position of the substring within str_a.
str_bThe second basic_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 compares.
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() [12/13]

template<typename char_t , typename traits_t , typename allocator_t >
static int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( const basic_string< char_t, traits_t, allocator_t > &  str_a,
xtd::size  index_a,
const basic_string< char_t, traits_t, allocator_t > &  str_b,
xtd::size  index_b,
xtd::size  length,
bool  ignore_case 
)
inlinestatic

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

Parameters
str_aThe first basic_string to use in the comparison.
index_aThe position of the substring within str_a.
str_bThe second basic_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 compares.
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() [13/13]

template<typename char_t , typename traits_t , typename allocator_t >
static int32 xtd::basic_string< char_t, traits_t, allocator_t >::compare ( const basic_string< char_t, traits_t, allocator_t > &  str_a,
xtd::size  index_a,
const basic_string< char_t, traits_t, allocator_t > &  str_b,
xtd::size  index_b,
xtd::size  length,
xtd::string_comparison  comparison_type 
)
inlinestatic

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

Parameters
str_aThe first basic_string to use in the comparison.
index_aThe position of the substring within str_a.
str_bThe second basic_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 compares.
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]

template<typename char_t , typename traits_t , typename allocator_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::concat ( const basic_string< char_t, traits_t, allocator_t > &  str_a,
const basic_string< char_t, traits_t, allocator_t > &  str_b,
const basic_string< char_t, traits_t, allocator_t > &  str_c,
const basic_string< char_t, traits_t, allocator_t > &  str_d 
)
inlinestaticnoexcept

Concatenates four specified instances of basic_string.

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

◆ concat() [2/9]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename object_a_t , typename object_b_t , typename object_c_t , typename object_d_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::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]

template<typename char_t , typename traits_t , typename allocator_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::concat ( const basic_string< char_t, traits_t, allocator_t > &  str_a,
const basic_string< char_t, traits_t, allocator_t > &  str_b,
const basic_string< char_t, traits_t, allocator_t > &  str_c 
)
inlinestaticnoexcept

Concatenates three specified instances of basic_string.

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

◆ concat() [4/9]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename object_a_t , typename object_b_t , typename object_c_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::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]

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

Concatenates two specified instances of basic_string.

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

◆ concat() [6/9]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename object_a_t , typename object_b_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::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]

template<typename char_t , typename traits_t , typename allocator_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::concat ( const xtd::array< basic_string< char_t, traits_t, allocator_t > > &  values)
staticnoexcept

Concatenates the elements of a specified basic_string array.

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

◆ concat() [8/9]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename object_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::concat ( const xtd::array< object_t > &  args)
staticnoexcept

Concatenates the basic_string representations of the elements in a specified object array.

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

◆ concat() [9/9]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename value_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::concat ( value_t  value)
inlinestaticnoexcept

Creates the basic_string representation of a specified object.

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

◆ demangle()

template<typename char_t , typename traits_t , typename allocator_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::demangle ( const basic_string< char_t, traits_t, allocator_t > &  name)
inlinestatic

Gets demangled basic_string of name,.

Parameters
nameThe name to demangle.
Returns
The demangled basic_string of name.
Examples
The following example shows how to use xtd::basic_string::demangle.
#include <xtd/xtd>
using namespace xtd;
auto main() -> int {
console::write_line("name = {}", typeid(xtd::date_time).name());
console::write_line("demangled name = {}", basic_string::demangle(typeid(xtd::date_time).name()));
}
// This code produces the following output on macOS :
//
// name = N3xtd9date_timeE
// demangled name = xtd::date_time
static basic_string demangle(const basic_string &name)
Gets demangled basic_string of name,.
Definition basic_string.hpp:2219
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.hpp:85
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10

◆ equals() [4/7]

template<typename char_t , typename traits_t , typename allocator_t >
static bool xtd::basic_string< char_t, traits_t, allocator_t >::equals ( const basic_string< char_t, traits_t, allocator_t > &  a,
const basic_string< char_t, traits_t, allocator_t > &  b 
)
inlinestaticnoexcept

Determines whether two specified xtd::basic_string objects have the same value.

Parameters
aThe first basic_string to compare.
bThe second basic_string to compare.
Returns
true if the value of a is the same as the value of b; otherwise, false.
Remarks
This method performs an ordinal (case-sensitive) comparison.

◆ equals() [5/7]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename char_a_t , typename char_b_t >
static bool xtd::basic_string< char_t, traits_t, allocator_t >::equals ( const char_a_t *  a,
const char_b_t *  b 
)
inlinestaticnoexcept

Determines whether two specified xtd::basic_string objects have the same value.

Parameters
aThe first basic_string to compare.
bThe second basic_string to compare.
Returns
true if the value of a is the same as the value of b; otherwise, false.
Remarks
This method performs an ordinal (case-sensitive) comparison.

◆ equals() [6/7]

template<typename char_t , typename traits_t , typename allocator_t >
static bool xtd::basic_string< char_t, traits_t, allocator_t >::equals ( const basic_string< char_t, traits_t, allocator_t > &  a,
const basic_string< char_t, traits_t, allocator_t > &  b,
bool  ignore_case 
)
inlinestaticnoexcept

Determines whether two specified xtd::basic_string objects have the same value, ignoring or honoring their case.

Parameters
aThe first basic_string to compare.
bThe second basic_string to compare.
ignore_casetrue to ignore case when comparing this instance and value; otherwise, false
Returns
true if the value of a is the same as the value of b; otherwise, false.
Remarks
This method performs an ordinal comparison.

◆ equals() [7/7]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename char_a_t , typename char_b_t >
static bool xtd::basic_string< char_t, traits_t, allocator_t >::equals ( const char_a_t *  a,
const char_b_t *  b,
bool  ignore_case 
)
inlinestaticnoexcept

Determines whether two specified xtd::basic_string objects have the same value, ignoring or honoring their case.

Parameters
aThe first basic_string to compare.
bThe second basic_string to compare.
ignore_casetrue to ignore case when comparing this instance and value; otherwise, false
Returns
true if the value of a is the same as the value of b; otherwise, false.
Remarks
This method performs an ordinal comparison.

◆ full_class_name() [1/3]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename object_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::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 basic_string type is xtd::basic_string.
Deprecated:
Replaced by typeof_<object_t>().full_name() - Will be removed in version 0.4.0.

◆ full_class_name() [2/3]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename object_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::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 basic_string type is xtd::basic_string.
Deprecated:
Replaced by typeof_(object).full_name() - Will be removed in version 0.4.0.

◆ full_class_name() [3/3]

template<typename char_t , typename traits_t , typename allocator_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::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 basic_string type is xtd::basic_string.
Deprecated:
Replaced by typeof_(info).full_name() - Will be removed in version 0.4.0.

◆ is_empty() [2/2]

template<typename char_t , typename traits_t , typename allocator_t >
static bool xtd::basic_string< char_t, traits_t, allocator_t >::is_empty ( const xtd::basic_string< value_type, traits_type, allocator_type > &  string)
inlinestaticnoexcept

Indicates whether the specifeid basic_string is an empty basic_string ("").

Parameters
stringThe xtd::basic_string to check if empty.
Returns
true if the value parameter is null or an empty basic_string (""); otherwise, false.

◆ join() [1/3]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename collection_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::join ( const basic_string< char_t, traits_t, allocator_t >  separator,
const collection_t &  values 
)
inlinestaticnoexcept

Concatenates a specified separator basic_string between each element of a specified object array, yielding a single concatenated basic_string.

Parameters
separatorA basic_string separator.
valuesAn array of Object.
Returns
A basic_string consisting of the elements of value interspersed with the separator basic_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.
Examples
test_forms.cpp, and uri.cpp.

◆ join() [2/3]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename collection_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::join ( const basic_string< char_t, traits_t, allocator_t > &  separator,
const collection_t &  values,
xtd::size  index 
)
inlinestatic

Concatenates a specified separator basic_string between each element of a specified object array, yielding a single concatenated basic_string.

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

◆ join() [3/3]

template<typename char_t , typename traits_t , typename allocator_t >
template<typename collection_t >
static basic_string xtd::basic_string< char_t, traits_t, allocator_t >::join ( const basic_string< char_t, traits_t, allocator_t > &  separator,
const collection_t &  values,
xtd::size  index,
xtd::size  count 
)
inlinestatic

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

Parameters
separatorA basic_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 basic_string consisting of the elements of value interspersed with the separator basic_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.

◆ parse()

template<typename char_t , typename traits_t , typename allocator_t >
template<typename value_t >
static value_t xtd::basic_string< char_t, traits_t, allocator_t >::parse ( const basic_string< char_t, traits_t, allocator_t > &  str)
inlinestatic

Converts a basic_string into a value_t type.

Parameters
strAx xtd::basic_string to convert to value_t
Returns
The value_t object parsed.

◆ try_parse()

template<typename char_t , typename traits_t , typename allocator_t >
template<typename value_t >
static bool xtd::basic_string< char_t, traits_t, allocator_t >::try_parse ( const basic_string< char_t, traits_t, allocator_t > &  str,
value_t &  value 
)
inlinestaticnoexcept

Try to convert a basic_string into a value_t type.

Parameters
strAn xtd::basic_string to convert to value_t
valueThe value that will contain the parsed xtd::basic_string.
Returns
true if xtd::basic_string:=:try_parse succed; otherwise, false.

◆ operator[]()

template<typename char_t , typename traits_t , typename allocator_t >
const_reference xtd::basic_string< char_t, traits_t, allocator_t >::operator[] ( xtd::size  index) const
inline

Returns a reference to the character at specified location index.

Parameters
indexThe position of the character to return.
Returns
Reference to the requested character.
Exceptions
xtd::index_out_of_range_exceptionIf `index` is not within the range of the string.

◆ operator const base_type &()

template<typename char_t , typename traits_t , typename allocator_t >
xtd::basic_string< char_t, traits_t, allocator_t >::operator const base_type & ( ) const
inlinenoexcept

Returns a reference to the underlying base type.

Returns
Reference to the underlying base type.

◆ operator=() [1/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const basic_string< char > &  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [2/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const basic_string< xtd::char16 > &  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [3/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const basic_string< xtd::char32 > &  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [4/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const basic_string< xtd::char8 > &  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [5/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const basic_string< xtd::wchar > &  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [6/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( basic_string< char > &&  str)
inlinenoexcept

Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in str is moved from str into this string). str is in a valid but unspecified state afterwards.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [7/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( basic_string< xtd::char16 > &&  str)
inlinenoexcept

Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in str is moved from str into this string). str is in a valid but unspecified state afterwards.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [8/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( basic_string< xtd::char32 > &&  str)
inlinenoexcept

Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in str is moved from str into this string). str is in a valid but unspecified state afterwards.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [9/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( basic_string< xtd::char8 > &&  str)
inlinenoexcept

Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in str is moved from str into this string). str is in a valid but unspecified state afterwards.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [10/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( basic_string< xtd::wchar > &&  str)
inlinenoexcept

Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in str is moved from str into this string). str is in a valid but unspecified state afterwards.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [11/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const std::basic_string< char > &  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [12/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const std::basic_string< xtd::char16 > &  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [13/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const std::basic_string< xtd::char32 > &  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [14/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const std::basic_string< xtd::char8 > &  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [15/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const std::basic_string< xtd::wchar > &  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [16/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( std::basic_string< char > &&  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [17/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( std::basic_string< xtd::char16 > &&  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [18/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( std::basic_string< xtd::char32 > &&  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [19/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( std::basic_string< xtd::char8 > &&  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [20/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( std::basic_string< xtd::wchar > &&  str)
inlinenoexcept

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString to use as data source.
Returns
This current instance.

◆ operator=() [21/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const char *  str)
inline

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString litteral pointer to use as data source.
Exceptions
xtd::tring_null_pointer_exceptionThe `str` is null.
Returns
This current instance.

◆ operator=() [22/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const xtd::char16 str)
inline

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString litteral pointer to use as data source.
Exceptions
xtd::tring_null_pointer_exceptionThe `str` is null.
Returns
This current instance.

◆ operator=() [23/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const xtd::char32 str)
inline

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString litteral pointer to use as data source.
Exceptions
xtd::tring_null_pointer_exceptionThe `str` is null.
Returns
This current instance.

◆ operator=() [24/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const xtd::char8 str)
inline

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString litteral pointer to use as data source.
Exceptions
xtd::tring_null_pointer_exceptionThe `str` is null.
Returns
This current instance.

◆ operator=() [25/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const xtd::wchar str)
inline

Copy assignment operator. Replaces the contents with a copy of the contents of str.

Parameters
strString litteral pointer to use as data source.
Exceptions
xtd::tring_null_pointer_exceptionThe `str` is null.
Returns
This current instance.

◆ operator=() [26/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( char  character)
inline

Copy assignment operator. Replaces the contents with the specified character.

Parameters
characterThe character to use as data source.
Returns
This current instance.

◆ operator=() [27/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( xtd::char16  character)
inline

Copy assignment operator. Replaces the contents with the specified character.

Parameters
characterThe character to use as data source.
Returns
This current instance.

◆ operator=() [28/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( xtd::char32  character)
inline

Copy assignment operator. Replaces the contents with the specified character.

Parameters
characterThe character to use as data source.
Returns
This current instance.

◆ operator=() [29/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( xtd::char8  character)
inline

Copy assignment operator. Replaces the contents with the specified character.

Parameters
characterThe character to use as data source.
Returns
This current instance.

◆ operator=() [30/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( xtd::wchar  character)
inline

Copy assignment operator. Replaces the contents with the specified character.

Parameters
characterThe character to use as data source.
Returns
This current instance.

◆ operator=() [31/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const std::initializer_list< char > &  il)
inline

Copy assignment operator. Replaces the contents with a copy of the contents of the specified initializer list.

Parameters
ilThe initialiazer list to use as data source.
Returns
This current instance.

◆ operator=() [32/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const std::initializer_list< xtd::char16 > &  il)
inline

Copy assignment operator. Replaces the contents with a copy of the contents of the specified initializer list.

Parameters
ilThe initialiazer list to use as data source.
Returns
This current instance.

◆ operator=() [33/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const std::initializer_list< xtd::char32 > &  il)
inline

Copy assignment operator. Replaces the contents with a copy of the contents of the specified initializer list.

Parameters
ilThe initialiazer list to use as data source.
Returns
This current instance.

◆ operator=() [34/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const std::initializer_list< xtd::char8 > &  il)
inline

Copy assignment operator. Replaces the contents with a copy of the contents of the specified initializer list.

Parameters
ilThe initialiazer list to use as data source.
Returns
This current instance.

◆ operator=() [35/35]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator= ( const std::initializer_list< xtd::wchar > &  il)
inline

Copy assignment operator. Replaces the contents with a copy of the contents of the specified initializer list.

Parameters
ilThe initialiazer list to use as data source.
Returns
This current instance.

◆ operator+=() [1/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const basic_string< char > &  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [2/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const basic_string< xtd::char16 > &  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [3/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const basic_string< xtd::char32 > &  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [4/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const basic_string< xtd::char8 > &  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [5/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const basic_string< xtd::wchar > &  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [6/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( basic_string< char > &&  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [7/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( basic_string< xtd::char16 > &&  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [8/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( basic_string< xtd::char32 > &&  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [9/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( basic_string< xtd::char8 > &&  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [10/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( basic_string< xtd::wchar > &&  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [11/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const std::basic_string< char > &  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [12/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const std::basic_string< xtd::char16 > &  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [13/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const std::basic_string< xtd::char32 > &  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [14/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const std::basic_string< xtd::char8 > &  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [15/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const std::basic_string< xtd::wchar > &  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [16/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const char *  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [17/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const xtd::char16 str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [18/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const xtd::char32 str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [19/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const xtd::char8 str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [20/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( const xtd::wchar str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [21/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( char  ch)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
chCharacter value to append.
Returns
This current instance with characters added.

◆ operator+=() [22/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( xtd::char16  ch)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
chCharacter value to append.
Returns
This current instance with characters added.

◆ operator+=() [23/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( xtd::char32  ch)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
chCharacter value to append.
Returns
This current instance with characters added.

◆ operator+=() [24/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( xtd::char8  ch)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
chCharacter value to append.
Returns
This current instance with characters added.

◆ operator+=() [25/25]

template<typename char_t , typename traits_t , typename allocator_t >
basic_string & xtd::basic_string< char_t, traits_t, allocator_t >::operator+= ( xtd::wchar  ch)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
chCharacter value to append.
Returns
This current instance with characters added.

Member Data Documentation

◆ empty_string

template<typename char_t , typename traits_t , typename allocator_t >
const basic_string xtd::basic_string< char_t, traits_t, allocator_t >::empty_string
static

Represents the empty basic_string.

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

◆ npos

template<typename char_t , typename traits_t , typename allocator_t >
constexpr size_type xtd::basic_string< char_t, traits_t, allocator_t >::npos
inlinestaticconstexpr

This is a special value equal to the maximum value representable by the type xtd::size.

Examples
test_forms.cpp.

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