xtd 0.2.0
Loading...
Searching...
No Matches
xtd::text::basic_string_builder< char_t, traits_t, allocator_t > Class Template Referencefinal
Inheritance diagram for xtd::text::basic_string_builder< char_t, traits_t, allocator_t >:
xtd::object xtd::iequatable< type_t > xtd::interface xtd::equality_operators< type_t, iequatable< type_t > >

Definition

template<typename char_t, typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
class xtd::text::basic_string_builder< char_t, traits_t, allocator_t >

Represents a mutable string of characters. This class cannot be inherited.

Namespace
xtd::text
Library
xtd.core
Remarks
xtd::text::basic_string_builder class represents a string-like object whose value is a mutable sequence of characters.
xtd::text::basic_string_builder implements std::basic_string<char> and therefore offers the full API of std::basic_string.
Several aliases for common character types are provided:
Type Definition
xtd::text::string_builder xtd::text::basic_string_builder <char>
xtd::text::u16string_builder xtd::text::basic_string_builder <xtd::char16>
xtd::text::u32string_builder xtd::text::basic_string_builder <xtd::char32>
xtd::text::u8string_builder xtd::text::basic_string_builder <xtd::char8>
xtd::text::wstring_builder xtd::text::basic_string_builder <xtd::wchar>
Examples
ip_address.cpp, ostream_unit_test.cpp, and string_builder_append.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 base_type::iterator
 Represents the basic string iterator type.
 
using const_iterator = typename base_type::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.
 

Public Fields

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

Public Constructors

 basic_string_builder ()=default
 Initializes a new instance of xtd::text::basic_string_builder.
 
 basic_string_builder (xtd::size capacity)
 Initializes a new instance of the xtd::text::basic_string_builder class using the specified capacity.
 
 basic_string_builder (xtd::size capacity, xtd::size max_capacity)
 Initializes a new instance of the xtd::text::basic_string_builder class that starts with a specified capacity and can grow to a specified maximum.
 
 basic_string_builder (const xtd::basic_string< value_type > &value)
 Initializes a new instance of the xtd::text::basic_string_builder class using the specified string.
 
 basic_string_builder (const xtd::basic_string< value_type > &value, xtd::size capacity)
 Initializes a new instance of the xtd::text::basic_string_builder class using the specified string and capacity.
 
 basic_string_builder (const xtd::basic_string< value_type > &value, xtd::size start_index, xtd::size length, xtd::size capacity)
 Initializes a new instance of the xtd::text::basic_string_builder class from the specified substring and capacity.
 
 basic_string_builder (const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::text::basic_string_builder with specified allocator.
 
 basic_string_builder (const basic_string_builder &str) noexcept
 Initializes a new instance of xtd::text::basic_string_builder with specified string to copy.
 
 basic_string_builder (const basic_string_builder &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::text::basic_string_builder with specified string to copy and allocator.
 
 basic_string_builder (const basic_string_builder &str, xtd::size index)
 Initializes a new instance of xtd::text::basic_string_builder with specified substring at index.
 
 basic_string_builder (const basic_string_builder &str, xtd::size index, const allocator_type &allocator)
 Initializes a new instance of xtd::text::basic_string_builder with specified substring at index and allocator.
 
 basic_string_builder (const basic_string_builder &str, xtd::size index, xtd::size count)
 Initializes a new instance of xtd::text::basic_string_builder with specified substring at index and count characters.
 
 basic_string_builder (const basic_string_builder &str, xtd::size index, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::text::basic_string_builder with specified substring at index, count characters and allocator.
 
 basic_string_builder (basic_string_builder &&str) noexcept
 Initializes a new instance of xtd::text::basic_string_builder with specified string to move.
 
 basic_string_builder (basic_string_builder &&str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::text::basic_string_builder with specified string to move and allocator.
 
 basic_string_builder (xtd::size count, value_type character)
 
 basic_string_builder (xtd::size count, value_type character, const allocator_type &allocator)
 Initializes a new instance of xtd::text::basic_string_builder with specified count copies of character and specified allocator.
 
 basic_string_builder (value_type character, xtd::size count)
 Initializes a new instance of xtd::text::basic_string_builder with specified count copies of character.
 
 basic_string_builder (value_type character, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::text::basic_string_builder with specified count copies of character and specified allocator.
 
 basic_string_builder (const_pointer str)
 Initializes a new instance of xtd::text::basic_string_builder with specified string to copy.
 
 basic_string_builder (const_pointer str, const allocator_type &allocator)
 Initializes a new instance of xtd::text::basic_string_builder with specified string to copy, and allocator.
 
 basic_string_builder (const_pointer str, xtd::size count)
 Initializes a new instance of xtd::text::basic_string_builder with specified substring and count characters.
 
 basic_string_builder (const_pointer str, xtd::size count, const allocator_type &allocator)
 Initializes a new instance of xtd::text::basic_string_builder with specified substring, count characters and allocator.
 
 basic_string_builder (const std::basic_string< value_type > &str) noexcept
 Initializes a new instance of xtd::text::basic_string_builder with specified string to copy.
 
 basic_string_builder (const std::basic_string< value_type > &str, const allocator_type &allocator) noexcept
 Initializes a new instance of xtd::text::basic_string_builder with specified string to copy and allocator.
 
template<typename input_iterator_t >
 basic_string_builder (input_iterator_t first, input_iterator_t last)
 Initializes a new instance of xtd::text::basic_string_builder with specified first and last iterators of substring.
 
template<typename input_iterator_t >
 basic_string_builder (input_iterator_t first, input_iterator_t last, const allocator_type &allocator)
 Initializes a new instance of xtd::text::basic_string_builder with specified first and last iterators of substring and allocator.
 
 basic_string_builder (std::initializer_list< value_type > il)
 Initializes a new instance of xtd::text::basic_string_builder with specified initializer list.
 
 basic_string_builder (std::initializer_list< value_type > il, const allocator_type &allocator)
 Initializes a new instance of xtd::text::basic_string_builder with specified initializer list and allocator.
 

Public Properties

const_reference back () const
 Returns reference to the last character in the string.
 
reference back ()
 Returns reference to the last character in the string.
 
const_iterator begin () const
 Returns an iterator to the first character of the string.
 
iterator begin ()
 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.
 
basic_string_buildercapacity (size_type value)
 Sets the number of characters that the string has currently allocated space for.
 
const_iterator cbegin () const
 Returns an iterator to the first character of the string.
 
const base_typechars () const noexcept
 Returns a reference to the underlying base type.
 
base_typechars () noexcept
 Returns a reference to the underlying base type.
 
const_iterator cend () const
 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_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.
 
pointer data () 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
 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.
 
iterator end ()
 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.
 
reference front ()
 Returns reference to the first character in the string. The behavior is undefined if empty() is true.
 
size_type length () const noexcept
 Gets or sets the length of the current xtd::text::basic_string_builder object.
 
basic_string_builderlength (size_type value) noexcept
 Sets or sets the length of the current xtd::text::basic_string_builder object.
 
size_type max_capacity () const noexcept
 Returns the number of characters that the string has currently allocated space for.
 
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.
 
size_type size () const noexcept
 Returns the number of char_t elements in the string, i.e. std::distance(begin(), end()).
 

Public Methods

basic_string_builderappend (const xtd::basic_string< char_t > &value)
 Appends a copy of the specified string to this instance.
 
basic_string_builderappend (const xtd::basic_string< char_t > &value, size_type start_index, size_type count)
 Appends a copy of a specified substring to this instance.
 
basic_string_builderappend (xtd::boolean value)
 Appends the string representation of a specified boolean value to this instance.
 
basic_string_builderappend (xtd::byte value)
 Appends the string representation of a specified 8-bit unsigned value to this instance.
 
basic_string_builderappend (xtd::decimal value)
 Appends the string representation of a specified decimal value to this instance.
 
basic_string_builderappend (double value)
 Appends the string representation of a specified double value to this instance.
 
basic_string_builderappend (xtd::single value)
 Appends the string representation of a specified single value to this instance.
 
basic_string_builderappend (xtd::int16 value)
 Appends the string representation of a specified 16-bit signed integer value to this instance.
 
basic_string_builderappend (xtd::int32 value)
 Appends the string representation of a specified 32-bit signed integer value to this instance.
 
basic_string_builderappend (xtd::int64 value)
 Appends the string representation of a specified 64-bit signed integer value to this instance.
 
basic_string_builderappend (xtd::sbyte value)
 Appends the string representation of a specified 8-bit signed integer value to this instance.
 
basic_string_builderappend (xtd::uint16 value)
 Appends the string representation of a specified 16-bit unsigned integer value to this instance.
 
basic_string_builderappend (xtd::uint32 value)
 Appends the string representation of a specified 32-bit unsigned integer value to this instance.
 
basic_string_builderappend (xtd::uint64 value)
 Appends the string representation of a specified 64-bit unsigned integer value to this instance.
 
basic_string_builderappend (value_type value)
 Appends the string representation of a specified xtd::text::basic_string_builder::value_type value to this instance.
 
basic_string_builderappend (value_type value, size_type repeat_count)
 Appends a specified number of copies of the string representation of a Unicode character to this instance.
 
template<typename object_t >
basic_string_builderappend (object_t value)
 Appends the string representation of a specified object to this instance.
 
basic_string_builderappend (size_type count, value_type ch)
 Appends additional characters to the string.
 
basic_string_builderappend (const basic_string_builder &str)
 Appends additional characters to the string.
 
basic_string_builderappend (const basic_string_builder &str, size_type pos)
 Appends additional characters to the string.
 
basic_string_builderappend (const basic_string_builder &str, size_type pos, size_type count)
 Appends additional characters to the string.
 
basic_string_builderappend (const_pointer s, size_type count)
 Appends additional characters to the string.
 
basic_string_builderappend (const_pointer s)
 Appends additional characters to the string.
 
template<class input_iterator_t >
basic_string_builderappend (input_iterator_t first, input_iterator_t last)
 Appends additional characters to the string.
 
basic_string_builderappend (std::initializer_list< value_type > ilist)
 Appends additional characters to the string.
 
template<typename ... args_t>
basic_string_builderappend_format (const xtd::basic_string< char_t > &format, args_t &&... args)
 Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a corresponding argument in a parameters.
 
template<typename collection_t >
basic_string_builderappend_join (const xtd::basic_string< char_t > &separator, const collection_t &values)
 Concatenates and appends the members of a collection, using the specified separator between each member.
 
template<typename collection_t >
basic_string_builderappend_join (value_type separator, const collection_t &values)
 Concatenates and appends the members of a collection, using the specified xtd::basic_string_builder::value_type separator between each member.
 
basic_string_builderappend_line ()
 Appends the default line terminator to the end of the current xtd::text::basic_string_builder object.
 
basic_string_builderappend_line (const xtd::basic_string< char_t > &value)
 Appends a copy of the specified string followed by the default line terminator to the end of the current xtd::text::basic_string_builder object.
 
const_reference at (size_type pos) const
 Returns a reference to the character at specified location pos.
 
reference at (size_type pos)
 Returns a reference to the character at specified location pos.
 
basic_string_builderclear ()
 Removes all characters from the current xtd::text::basic_string_builder instance.
 
int32 compare (const basic_string_builder &str) const
 Compares two character sequences.
 
int32 compare (size_type pos1, size_type count1, const basic_string_builder &str) const
 Compares two character sequences.
 
int32 compare (size_type pos1, size_type count1, const basic_string_builder &str, size_type pos2) const
 Compares two character sequences.
 
int32 compare (size_type pos1, size_type count1, const basic_string_builder &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.
 
size_type copy (pointer dest, size_type count) const
 Copies a substring [pos, pos + count) to character string pointed to by dest. If the requested substring lasts past the end of the string, or if count == npos, the copied substring is [pos, size()).
 
size_type copy (pointer dest, size_type count, size_type pos) const
 Copies a substring [pos, pos + count) to character string pointed to by dest. If the requested substring lasts past the end of the string, or if count == npos, the copied substring is [pos, size()).
 
void copy_to (xtd::size source_index, xtd::array< value_type > &destination, xtd::size destination_index, xtd::size destination_count) const
 Copies the characters from a specified segment of this instance to a specified segment of a destination xtd::text::basic_string_builder::value_type array.
 
bool equals (const object &obj) const noexcept override
 Determines whether this instance and a specified object, which must also be a xtd::text::basic_string_builder object, have the same value.
 
bool equals (const basic_string_builder &value) const noexcept override
 Determines whether this instance and another specified xtd::text::basic_string_builder object have the same value.
 
size_type ensure_capacity (size_type capacity)
 Ensures that the capacity of this instance of xtd::text::basic_string_builder is at least the specified value.
 
basic_string_buildererase ()
 Removes specified characters from the string.
 
basic_string_buildererase (size_type index)
 Removes specified characters from the string.
 
basic_string_buildererase (size_type index, size_type count)
 Removes specified characters from the string.
 
iterator erase (const_iterator position)
 Removes specified characters from the string.
 
iterator erase (const_iterator first, const_iterator last)
 Removes specified characters from the string.
 
size_type find (const basic_string_builder &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_builder &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_builder &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::text::basic_string_builder::npos will be returned.
 
size_type find_first_of (const basic_string_builder &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::text::basic_string_builder::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::text::basic_string_builder::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::text::basic_string_builder::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::text::basic_string_builder::npos will be returned.
 
size_type find_first_of (value_type 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::text::basic_string_builder::npos will be returned.
 
size_type find_first_of (value_type 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::text::basic_string_builder::npos will be returned.
 
size_type find_first_not_of (const basic_string_builder &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::text::basic_string_builder::npos will be returned.
 
size_type find_first_not_of (const basic_string_builder &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::text::basic_string_builder::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::text::basic_string_builder::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::text::basic_string_builder::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::text::basic_string_builder::npos will be returned.
 
size_type find_first_not_of (value_type 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::text::basic_string_builder::npos will be returned.
 
size_type find_first_not_of (value_type 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::text::basic_string_builder::npos will be returned.
 
size_type find_last_of (const basic_string_builder &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::text::basic_string_builder::npos will be returned.
 
size_type find_last_of (const basic_string_builder &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::text::basic_string_builder::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::text::basic_string_builder::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::text::basic_string_builder::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::text::basic_string_builder::npos will be returned.
 
size_type find_last_of (value_type 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::text::basic_string_builder::npos will be returned.
 
size_type find_last_of (value_type 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::text::basic_string_builder::npos will be returned.
 
size_type find_last_not_of (const basic_string_builder &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::text::basic_string_builder::npos will be returned.
 
size_type find_last_not_of (const basic_string_builder &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::text::basic_string_builder::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::text::basic_string_builder::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::text::basic_string_builder::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::text::basic_string_builder::npos will be returned.
 
size_type find_last_not_of (value_type 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::text::basic_string_builder::npos will be returned.
 
size_type find_last_not_of (value_type 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::text::basic_string_builder::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_builder.
 
basic_string_builderinsert (size_type index, const xtd::basic_string< char_t > &value)
 Inserts a string into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, const xtd::basic_string< char_t > &value, size_type count)
 Inserts one or more copies of a specified string into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, xtd::boolean value)
 Inserts the string representation of a boolean value into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, xtd::byte value)
 Inserts the string representation of a specified 8-bit unsigned integer into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, xtd::decimal value)
 Inserts the string representation of a specified 8decimal into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, double value)
 Inserts the string representation of a specified double into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, xtd::single value)
 Inserts the string representation of a specified single into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, xtd::int16 value)
 Inserts the string representation of a specified 16-bit signed integer into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, xtd::int32 value)
 Inserts the string representation of a specified 32-bit signed integer into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, xtd::int64 value)
 Inserts the string representation of a specified 64-bit signed integer into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, xtd::sbyte value)
 Inserts the string representation of a specified 8-bit signed integer into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, xtd::uint16 value)
 Inserts the string representation of a specified 16-bit unsigned integer into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, xtd::uint32 value)
 Inserts the string representation of a specified 32-bit unsigned integer into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, xtd::uint64 value)
 Inserts the string representation of a specified 64-bit unsigned integer into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, value_type value)
 Inserts the string representation of a specified Unicode character into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, value_type value, size_type repeat_count)
 Inserts a specified number of copies of the string representation of a Unicode character to this instance at the specified character position.
 
template<typename object_t >
basic_string_builderinsert (size_type index, object_t value)
 Inserts the string representation of a specified object into this instance at the specified character position.
 
basic_string_builderinsert (size_type index, size_type count, value_type ch)
 Inserts characters into the string.
 
basic_string_builderinsert (size_type index, const_pointer s)
 Inserts characters into the string.
 
basic_string_builderinsert (size_type index, const_pointer s, size_type count)
 Inserts characters into the string.
 
basic_string_builderinsert (size_type index, const basic_string_builder &str)
 Inserts characters into the string.
 
basic_string_builderinsert (size_type index, const basic_string_builder &str, size_type s_index, size_type count)
 Inserts characters into the string.
 
basic_string_builderinsert (size_type index, const basic_string_builder &str, size_type s_index)
 Inserts characters into the string.
 
iterator insert (const_iterator pos, value_type ch)
 Inserts characters into the string.
 
iterator insert (const_iterator pos, size_type count, value_type ch)
 Inserts characters into the string.
 
template<typename input_iterator_t >
iterator insert (const_iterator pos, input_iterator_t first, input_iterator_t last)
 Inserts characters into the string.
 
iterator insert (const_iterator pos, std::initializer_list< value_type > ilist)
 Inserts characters into the string.
 
void pop_back ()
 Removes the last character from the string.
 
void push_back (value_type ch)
 Appends the given character ch to the end of the string.
 
basic_string_builderremove (size_type start_index, size_type length)
 Removes the specified range of characters from this instance.
 
basic_string_builderreplace (value_type old_char, value_type new_char) noexcept
 Replaces all occurrences of a specified character in this instance with another specified character.
 
basic_string_builderreplace (value_type old_char, value_type new_char, size_type start_index, size_type count)
 Replaces, within a substring of this instance, all occurrences of a specified character with another specified character.
 
basic_string_builderreplace (const xtd::basic_string< char_t > &old_value, const xtd::basic_string< char_t > &new_value) noexcept
 Replaces all occurrences of a specified string in this instance with another specified string.
 
basic_string_builderreplace (const xtd::basic_string< char_t > &old_value, const xtd::basic_string< char_t > &new_value, size_type start_index, size_type count)
 Replaces, within a substring of this instance, all occurrences of a specified string with another specified string.
 
basic_string_builderreplace (size_type pos, size_type count, const basic_string_builder &str)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
basic_string_builderreplace (const_iterator first, const_iterator last, const basic_string_builder &str)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
basic_string_builderreplace (size_type pos, size_type count, const basic_string_builder &str, size_type pos2)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
basic_string_builderreplace (size_type pos, size_type count, const basic_string_builder &str, size_type pos2, size_type count2)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
basic_string_builderreplace (size_type pos, size_type count, const_pointer cstr, size_type count2)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
basic_string_builderreplace (const_iterator first, const_iterator last, const_pointer cstr, size_type count2)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
basic_string_builderreplace (size_type pos, size_type count, const_pointer cstr)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
basic_string_builderreplace (const_iterator first, const_iterator last, const_pointer cstr)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
basic_string_builderreplace (size_type pos, size_type count, size_type count2, value_type ch)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
basic_string_builderreplace (const_iterator first, const_iterator last, size_type count2, value_type ch)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
template<typename input_iterator_t >
basic_string_builderreplace (const_iterator first, const_iterator last, input_iterator_t first2, input_iterator_t last2)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
basic_string_builderreplace (const_iterator first, const_iterator last, std::initializer_list< value_type > ilist)
 Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
 
void reserve (size_type new_cap)
 Informs a xtd::text::basic_string_builder object of a planned change in size, so that it can manage the storage allocation appropriately.
 
void resize (size_type count)
 Resizes the string to contain count characters.
 
void resize (size_type count, value_type ch)
 Resizes the string to contain count characters.
 
size_type rfind (const basic_string_builder &str) const
 Finds the last substring that is equal to the given character sequence. The search begins at xtd::text::basic_string_builder::nposand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following xtd::text::basic_string_builder::npos). If xtd::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::size() - 1 is passed as xtd::text::basic_string_builder::npos, the whole string will be searched. @return Position of the first character of the found substring or xtd::text::basic_string_builder::npos if no such substring is found. @remarks Finds the first substring equal tostr`.
 
size_type rfind (const basic_string_builder &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::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::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::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::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::text::basic_string_builder::nposand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following xtd::text::basic_string_builder::npos). If xtd::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::size() - 1 is passed as xtd::text::basic_string_builder::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::text::basic_string_builder::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::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::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::text::basic_string_builder::nposand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following xtd::text::basic_string_builder::npos). If xtd::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::size() - 1 is passed as xtd::text::basic_string_builder::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::text::basic_string_builder::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::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::size() - 1 is passed as pos, the whole string will be searched.
 
void shrink_to_fit ()
 Requests the removal of unused capacity.
 
basic_string_builder 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::text::basic_string_builder::npos), the returned substring is [pos, size()).
 
basic_string_builder 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::text::basic_string_builder::npos), the returned substring is [pos, size()).
 
basic_string_builder 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::text::basic_string_builder::npos), the returned substring is [pos, size()).
 
void swap (basic_string_builder &other) noexcept
 Exchanges the contents of the string with those of other. All iterators and references may be invalidated.
 
xtd::string to_string () const noexcept override
 Converts the value of this instance to a xtd::text::basic_string_builder <char>.
 

Public Operators

const_reference operator[] (xtd::size index) const
 Returns a reference to the character at specified location index.
 
reference operator[] (xtd::size index)
 Returns a reference to the character at specified location index.
 
 operator const base_type & () const noexcept
 Returns a reference to the underlying base type.
 
 operator base_type & () noexcept
 Returns a reference to the underlying base type.
 
basic_string_builderoperator= (const basic_string_builder &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_string_builderoperator= (basic_string_builder &&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_string_builderoperator= (const std::basic_string< value_type > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_string_builderoperator= (std::basic_string< value_type > &&str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_string_builderoperator= (const xtd::basic_string< value_type > &str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_string_builderoperator= (xtd::basic_string< value_type > &&str) noexcept
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_string_builderoperator= (const_pointer str)
 Copy assignment operator. Replaces the contents with a copy of the contents of str.
 
basic_string_builderoperator= (value_type character)
 Copy assignment operator. Replaces the contents with the specified character.
 
basic_string_builderoperator= (const std::initializer_list< value_type > &il)
 Copy assignment operator. Replaces the contents with a copy of the contents of the specified initializer list.
 
basic_string_builderoperator+= (const basic_string_builder &str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_string_builderoperator+= (basic_string_builder &&str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_string_builderoperator+= (const_pointer str)
 Addition assignment operator. Appends additional characters to the string.
 
basic_string_builderoperator+= (value_type ch)
 Addition assignment operator. Appends additional characters to the string.
 

Additional Inherited Members

- 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::iequatable< type_t >
virtual bool equals (const type_t &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
 
- 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::iterator = typename base_type::iterator

Represents the basic string iterator type.

Todo:
replace xtd::ienumerable::iterator

◆ const_iterator

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::const_iterator = typename base_type::const_iterator

Represents the basic string const iterator type.

Todo:
replace xtd::ienumerable::const_iterator

◆ reverse_iterator

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::const_reverse_iterator = typename base_type::const_reverse_iterator

Represents the basic string const reverse iterator type.

Constructor & Destructor Documentation

◆ basic_string_builder() [1/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( )
default

Initializes a new instance of xtd::text::basic_string_builder.

Examples
The following example demonstrates how to call the xtd::text::basic_string_builder constructor with no parameters.
auto sb = string_builder();
xtd::text::basic_string_builder< char > string_builder
Represents text as a sequence of UTF-8 code units.
Definition string_builder.h:20

◆ basic_string_builder() [2/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( xtd::size  capacity)
inline

Initializes a new instance of the xtd::text::basic_string_builder class using the specified capacity.

Parameters
capacityThe suggested starting size of this instance.
Exceptions
argument_out_of_range_exception`capacity` is greater than xtd::text::basic_string_builder::max_capacity.
Examples
The following example demonstrates how to call the xtd::text::basic_string_builder constructor with a specified capacity.
auto capacity = 255_z;
size_type capacity() const noexcept
Returns the number of characters that the string has currently allocated space for.
Definition basic_string_builder.h:324
Remarks
The capacity parameter defines the maximum number of characters that can be stored in the memory allocated by the current instance. Its value is assigned to the xtd::text::basic_string_builder::capacity property. If the number of characters to be stored in the current instance exceeds this capacity value, the xtd::text::basic_string_builder object allocates additional memory to store them.
The string value of this instance is set to xtd::string::empty_string. If capacity is zero, the implementation-specific default capacity is used.

◆ basic_string_builder() [3/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( xtd::size  capacity,
xtd::size  max_capacity 
)
inline

Initializes a new instance of the xtd::text::basic_string_builder class that starts with a specified capacity and can grow to a specified maximum.

Parameters
capacityThe suggested starting size of the xtd::text::basic_string_builder..
max_capacityThe maximum number of characters the current string can contain.
Exceptions
xtd::argument_out_of_range_exception`capacity` is greater than `max_capacity`.
Examples
The following example demonstrates how to call the xtd::text::basic_string_builder constructor with a specified capacity and maximum capacity.
auto capacity = 255_z;
auto max_capacity = 1024_z
size_type max_capacity() const noexcept
Returns the number of characters that the string has currently allocated space for.
Definition basic_string_builder.h:409
Remarks
The capacity parameter defines the maximum number of characters that can be stored in the memory allocated by the current instance. Its value is assigned to the xtd::text::basic_string_builder::capacity property. If the number of characters to be stored in the current instance exceeds this capacity value, the xtd::text::basic_string_builder object allocates additional memory to store them.
If capacity is zero, the implementation-specific default capacity is used.
The max_capacity parameter defines the maximum number of characters that the current instance can hold. Its value is assigned to the xtd::text::basic_string_builder::max_capacity property. If the number of characters to be stored in the current instance exceeds this max_capacity value, the xtd::text::basic_string_builder object does not allocate additional memory, but instead throws an exception.

◆ basic_string_builder() [4/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const xtd::basic_string< value_type > &  value)
inline

Initializes a new instance of the xtd::text::basic_string_builder class using the specified string.

Parameters
valueThe string used to initialize the value of the instance.
Examples
The following example demonstrates how to call the xtd::text::basic_string_builder constructor with the specified string.
auto initial_string = "Initial string."_s;
auto sb = string_builder(initial_string);

◆ basic_string_builder() [5/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const xtd::basic_string< value_type > &  value,
xtd::size  capacity 
)
inline

Initializes a new instance of the xtd::text::basic_string_builder class using the specified string and capacity.

Parameters
valueThe string used to initialize the value of the instance.
capacityThe suggested starting size of the xtd::text::basic_string_builder.
Examples
The following example demonstrates how to call the xtd::text::basic_string_builder constructor with an initial string and a specified capacity.
auto initial_string = "Initial string."_s;
auto capacity = 255_z;
auto sb = string_builder(initial_string, capacity);
Remarks
The capacity parameter defines the maximum number of characters that can be stored in the memory allocated by the current instance. Its value is assigned to the xtd::text::basic_string_builder::capacity property. If the number of characters to be stored in the current instance exceeds this capacity value, the xtd::text::basic_string_builder object allocates additional memory to store them.

◆ basic_string_builder() [6/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const xtd::basic_string< value_type > &  value,
xtd::size  start_index,
xtd::size  length,
xtd::size  capacity 
)
inline

Initializes a new instance of the xtd::text::basic_string_builder class from the specified substring and capacity.

Parameters
valueThe string that contains the substring used to initialize the value of this instance.
start_indexThe position within value where the substring begins.
lengthThe number of characters in the substring.
capacityThe suggested starting size of the xtd::text::basic_string_builder.
Exceptions
xtd::argument_out_of_range_exception`start_index` plus `length` is not a position within `value`.
Examples
The following example demonstrates how to call the xtd::text::basic_string_builder constructor with an initial string and a specified capacity.
auto initial_string = "Initial string for stringbuilder."_s;
auto start_index = 0_z;
auto length = 14_z;
auto capacity = 255_z;
auto sb = string_builder(initial_string, start_index, length, capacity);
size_type length() const noexcept
Gets or sets the length of the current xtd::text::basic_string_builder object.
Definition basic_string_builder.h:392
Remarks
The capacity parameter defines the maximum number of characters that can be stored in the memory allocated by the current instance. Its value is assigned to the xtd::text::basic_string_builder::capacity property. If the number of characters to be stored in the current instance exceeds this capacity value, the xtd::text::basic_string_builder object allocates additional memory to store them.

◆ basic_string_builder() [7/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const allocator_type allocator)
inlineexplicitnoexcept

Initializes a new instance of xtd::text::basic_string_builder with specified allocator.

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

◆ basic_string_builder() [8/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const basic_string_builder< char_t, traits_t, allocator_t > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string_builder() [9/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const basic_string_builder< char_t, traits_t, allocator_t > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string_builder() [10/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const basic_string_builder< char_t, traits_t, allocator_t > &  str,
xtd::size  index 
)
inline

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

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

◆ basic_string_builder() [11/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const basic_string_builder< char_t, traits_t, allocator_t > &  str,
xtd::size  index,
const allocator_type allocator 
)
inline

Initializes a new instance of xtd::text::basic_string_builder 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_builder.
Exceptions
xtd::index_out_of_range_exception`index` is greater or equal than `str` size.

◆ basic_string_builder() [12/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const basic_string_builder< char_t, traits_t, allocator_t > &  str,
xtd::size  index,
xtd::size  count 
)
inline

Initializes a new instance of xtd::text::basic_string_builder 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::index_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string_builder() [13/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const basic_string_builder< char_t, traits_t, allocator_t > &  str,
xtd::size  index,
xtd::size  count,
const allocator_type allocator 
)
inline

Initializes a new instance of xtd::text::basic_string_builder 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_builder.
Exceptions
xtd::index_out_of_range_exception`index` + `count`is greater or equal than `str` size.

◆ basic_string_builder() [14/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( basic_string_builder< char_t, traits_t, allocator_t > &&  str)
inlinenoexcept

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

Parameters
strThe basic_string_builder to move.

◆ basic_string_builder() [15/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( basic_string_builder< char_t, traits_t, allocator_t > &&  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string_builder() [16/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( xtd::size  count,
value_type  character 
)
inline
Parameters
strThe string to copy.
countThe number of copies of character.
characterThe character copied.

◆ basic_string_builder() [17/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( xtd::size  count,
value_type  character,
const allocator_type allocator 
)
inline

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

◆ basic_string_builder() [18/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( value_type  character,
xtd::size  count 
)
inline

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

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

◆ basic_string_builder() [19/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( value_type  character,
xtd::size  count,
const allocator_type allocator 
)
inline

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

◆ basic_string_builder() [20/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const_pointer  str)
inline

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

Parameters
strThe string to copy.

◆ basic_string_builder() [21/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const_pointer  str,
const allocator_type allocator 
)
inline

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

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

◆ basic_string_builder() [22/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const_pointer  str,
xtd::size  count 
)
inline

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

Parameters
countThe number of substring characters to copy.

◆ basic_string_builder() [23/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const_pointer  str,
xtd::size  count,
const allocator_type allocator 
)
inline

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

◆ basic_string_builder() [24/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const std::basic_string< value_type > &  str)
inlinenoexcept

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

Parameters
strThe string to copy.

◆ basic_string_builder() [25/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( const std::basic_string< value_type > &  str,
const allocator_type allocator 
)
inlinenoexcept

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

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

◆ basic_string_builder() [26/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
template<typename input_iterator_t >
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( input_iterator_t  first,
input_iterator_t  last 
)
inline

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

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

◆ basic_string_builder() [27/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
template<typename input_iterator_t >
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( input_iterator_t  first,
input_iterator_t  last,
const allocator_type allocator 
)
inline

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

◆ basic_string_builder() [28/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( std::initializer_list< value_type il)
inline

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

Parameters
ilThe initializer list to fill.

◆ basic_string_builder() [29/29]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::basic_string_builder ( std::initializer_list< value_type il,
const allocator_type allocator 
)
inline

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

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

Member Function Documentation

◆ back() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
const_reference xtd::text::basic_string_builder< 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.

◆ back() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
reference xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::back ( )
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() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
const_iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::begin ( ) const
inline

Returns an iterator to the first character of the string.

Returns
Iterator to the first character.

◆ begin() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::begin ( )
inline

Returns an iterator to the first character of the string.

Returns
Iterator to the first character.

◆ c_str()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
const_pointer xtd::text::basic_string_builder< 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:
  • 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(), rbegin(), end() and rend().
Writing to the character array accessed through c_str() is undefined behavior.
c_str() and data() perform the same function.

◆ capacity() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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.

◆ capacity() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::capacity ( size_type  value)
inline

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

Parameters
valueCapacity of the currently allocated storage, i.e. the storage available for storing elements.

◆ cbegin()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
const_iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::cbegin ( ) const
inline

Returns an iterator to the first character of the string.

Returns
Iterator to the first character.

◆ chars() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
const base_type & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::chars ( ) const
inlinenoexcept

Returns a reference to the underlying base type.

Returns
Reference to the underlying base type.

◆ chars() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
base_type & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::chars ( )
inlinenoexcept

Returns a reference to the underlying base type.

Returns
Reference to the underlying base type.

◆ cend()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
const_iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::cend ( ) const
inline

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.

◆ data() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
const_pointer xtd::text::basic_string_builder< 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.

◆ data() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
pointer xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::data ( )
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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
bool xtd::text::basic_string_builder< 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.

◆ end() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
const_iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::end ( ) const
inline

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.

◆ end() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::end ( )
inline

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.

◆ front() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
const_reference xtd::text::basic_string_builder< 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.

◆ front() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
reference xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::front ( )
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() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::length ( ) const
inlinenoexcept

Gets or sets the length of the current xtd::text::basic_string_builder object.

Returns
The length of this instance.
Remarks
The length of a xtd::text::basic_string_builder object is defined by its number of xtd::text::basic_string_builder::value_type objects.
Like the xtd::basic_string::length property, the xtd::text::basic_string_builder::length property indicates the length of the current string object. Unlike the xtd::basic_string::length property, which is read-only, the xtd::text::basic_string_builder::length property allows you to modify the length of the string stored to the xtd::text::basic_string_builder object.
If the specified length is less than the current length, the current xtd::text::basic_string_builder object is truncated to the specified length. If the specified length is greater than the current length, the end of the string value of the current xtd::text::basic_string_builder object is padded with the Unicode NULL character (U+0000).
If the specified length is greater than the current capacity, xtd::text::basic_string_builder::capacity increases so that it is greater than or equal to the specified length.
The xtd::text::basic_string_builder::length property returns the number of xtd::text::basic_string_builder::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::text::basic_string_builder::value_type.

◆ length() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::length ( size_type  value)
inlinenoexcept

Sets or sets the length of the current xtd::text::basic_string_builder object.

Parameters
valueThe length of this instance.
Returns
A reference to this instance after the length has been modified.
Exceptions
xtd::argument_out_of_range_exceptionThe value specified for a set operation is less than zero or greater than xtd::text::basic_string_builder::max_capacity.
Remarks
The length of a xtd::text::basic_string_builder object is defined by its number of xtd::text::basic_string_builder::value_type objects.
Like the xtd::basic_string::length property, the xtd::text::basic_string_builder::length property indicates the length of the current string object. Unlike the xtd::basic_string::length property, which is read-only, the xtd::text::basic_string_builder::length property allows you to modify the length of the string stored to the xtd::text::basic_string_builder object.
If the specified length is less than the current length, the current xtd::text::basic_string_builder object is truncated to the specified length. If the specified length is greater than the current length, the end of the string value of the current xtd::text::basic_string_builder object is padded with the Unicode NULL character (U+0000).
If the specified length is greater than the current capacity, xtd::text::basic_string_builder::capacity increases so that it is greater than or equal to the specified length.
The xtd::text::basic_string_builder::length property returns the number of xtd::text::basic_string_builder::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::text::basic_string_builder::value_type.

◆ max_capacity()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::max_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.

◆ max_size()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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.

◆ size()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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.

◆ append() [1/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( const xtd::basic_string< char_t > &  value)
inline

Appends a copy of the specified string to this instance.

Parameters
valueThe string to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (const xtd::basic_string&) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto flag = false;
sb.append("The value of the flag is ").append(flag).append(".");
console::write_line(sb.to_string());
// The example displays the following output:
//
// The value of the flag is false.
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Represents a mutable string of characters. This class cannot be inherited.
Definition basic_string_builder.h:35
basic_string_builder & append(const xtd::basic_string< char_t > &value)
Appends a copy of the specified string to this instance.
Definition basic_string_builder.h:442
If value is empty, no changes are made.
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.
Examples
string_builder_append.cpp.

◆ append() [2/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( const xtd::basic_string< char_t > &  value,
size_type  start_index,
size_type  count 
)
inline

Appends a copy of a specified substring to this instance.

Parameters
valueThe string that contains the substring to append.
start_indexThe starting position of the substring within value.
countThe number of characters in value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
-or-
`start_index` + `count` is greater than the length of `value`.
Remarks
This method appends the specified range of characters in value to the current instance. If value is empty and start_index and count are both zero, no changes are made.
The xtd::text::basic_string_builder::append (const xtd::basic_string&, size_type, size_type) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto str = "First;George Washington;1789;1797"_s;
auto index = 0_z;
auto length = str.index_of(';', index);
sb.append(str, index, length).append(" President of the United States: ");
index += length + 1;
length = str.index_of(';', index) - index;
sb.append(str, index, length).append(", from ");
index += length + 1;
length = str.index_of(';', index) - index;
sb.append(str, index, length).append(" to ");
index += length + 1;
sb.append(str, index, str.length() - index);
// The example displays the following output:
//
// First President of the United States: George Washington, from 1789 to 1797
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [3/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( xtd::boolean  value)
inline

Appends the string representation of a specified boolean value to this instance.

Parameters
valueThe boolean value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::boolean) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto flag = false;
sb.append("The value of the flag is ").append(flag).append(".");
console::write_line(sb.to_string());
// The example displays the following output:
//
// The value of the flag is false.
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [4/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( xtd::byte  value)
inline

Appends the string representation of a specified 8-bit unsigned value to this instance.

Parameters
valueThe 8-bit unsigned value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::byte) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto bytes = array<byte> {16, 132, 27, 253};
for (auto value : bytes)
sb.append(value).append(" ");
console::write_line("The byte array: {0}", sb.to_string());
// The example displays the following output:
//
// The byte array: 16 132 27 253
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.h:58
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [5/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( xtd::decimal  value)
inline

Appends the string representation of a specified decimal value to this instance.

Parameters
valueThe decimal value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::decimal) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto value = 1346.19l;
sb.append('*', 5).append(value).append('*', 5);
// The example displays the following output:
//
// *****1346.19*****
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [6/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( double  value)
inline

Appends the string representation of a specified double value to this instance.

Parameters
valueThe double value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (double) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto value = 1346.19;
sb.append('*', 5).append(value).append('*', 5);
// The example displays the following output:
//
// *****1346.19*****
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [7/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( xtd::single  value)
inline

Appends the string representation of a specified single value to this instance.

Parameters
valueThe single value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::single) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto value = 1346.19f;
sb.append('*', 5).append(value).append('*', 5);
// The example displays the following output:
//
// *****1346.19*****
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [8/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( xtd::int16  value)
inline

Appends the string representation of a specified 16-bit signed integer value to this instance.

Parameters
valueThe 16-bit signed value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::int16) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto value = 1346_s16;
sb.append('*', 5).append(value).append('*', 5);
// The example displays the following output:
//
// *****1346*****
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [9/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( xtd::int32  value)
inline

Appends the string representation of a specified 32-bit signed integer value to this instance.

Parameters
valueThe 32-bit signed value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::int32) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto value = 1346;
sb.append('*', 5).append(value).append('*', 5);
// The example displays the following output:
//
// *****1346*****
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [10/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( xtd::int64  value)
inline

Appends the string representation of a specified 64-bit signed integer value to this instance.

Parameters
valueThe 64-bit signed value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::int64) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto value = 1346_s64;
sb.append('*', 5).append(value).append('*', 5);
// The example displays the following output:
//
// *****1346*****
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [11/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( xtd::sbyte  value)
inline

Appends the string representation of a specified 8-bit signed integer value to this instance.

Parameters
valueThe 8-bit signed integer value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::sbyte) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto bytes = array<sbyte> {16, 132, 27, 253};
for (auto value : bytes)
sb.append(value).append(" ");
console::write_line("The byte array: {0}", sb.to_string());
// The example displays the following output:
//
// The byte array: 16 132 27 253
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [12/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( xtd::uint16  value)
inline

Appends the string representation of a specified 16-bit unsigned integer value to this instance.

Parameters
valueThe 16-bit unsigned value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::uint16) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto value = 1346_u16;
sb.append('*', 5).append(value).append('*', 5);
// The example displays the following output:
//
// *****1346*****
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [13/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( xtd::uint32  value)
inline

Appends the string representation of a specified 32-bit unsigned integer value to this instance.

Parameters
valueThe 32-bit unsigned value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::uint32) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto value = 1346_u32;
sb.append('*', 5).append(value).append('*', 5);
// The example displays the following output:
//
// *****1346*****
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [14/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( xtd::uint64  value)
inline

Appends the string representation of a specified 64-bit unsigned integer value to this instance.

Parameters
valueThe 64-bit unsigned value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::uint64) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto value = 1346_u64;
sb.append('*', 5).append(value).append('*', 5);
// The example displays the following output:
//
// *****1346*****
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [15/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( value_type  value)
inline

Appends the string representation of a specified xtd::text::basic_string_builder::value_type value to this instance.

Parameters
valueThe xtd::text::basic_string_builder::value_type value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::text::basic_string_builder::value_type) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto str = "Characters in a string.";
for (auto ch : str)
sb.append(" '").append(ch).append("' ");
console::write_line("Characters in the string:");
// The example displays the following output:
//
// Characters in the string:
// 'C' 'h' 'a' 'r' 'a' 'c' 't' 'e' 'r' 's' ' ' 'i' 'n' ' ' 'a' ' ' 's' 't' 'r' 'i' 'n' 'g' '.'
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [16/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( value_type  value,
size_type  repeat_count 
)
inline

Appends a specified number of copies of the string representation of a Unicode character to this instance.

Parameters
valueThe character to append.
repeat_countThe number of times to append value.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (xtd::text::basic_string_builder::value_type, xtd::text::basic_string_builder::size_type) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates.
auto value = 1346.19;
sb.append('*', 5).append(value).append('*', 5);
// The example displays the following output:
//
// *****1346.19*****
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [17/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
template<typename object_t >
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( object_t  value)
inline

Appends the string representation of a specified object to this instance.

Template Parameters
object_tThe type of object to append.
Parameters
valueThe object to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The xtd::text::basic_string_builder::append (object_t) method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a xtd::text::basic_string_builder object, as the following example illustrates. It defines a dog class, creates a dog object, and makes three calls to the xtd::text::basic_string_builder::append method to create a string that contains the dog's name and breed.
#include <xtd/text/string_builder>
#include <xtd/console>
#include <xtd/istringable>
using namespace xtd;
class dog : public istringable {
private:
string dog_breed;
string dog_name;
public:
dog(const string& name, const string& breed) : dog_breed(breed), dog_name(name) {}
const string& breed() const noexcept {return dog_breed;}
const string& name() const noexcept {return dog_name;}
string to_string() const noexcept override {return dog_name;}
};
auto main() -> int {
auto dog1 = dog {"Mocka", "American Shepherd"};
sb.append(dog1).append(", breed: ").append(dog1.breed());
}
// This code produces the following output :
//
// Mocka, breed: American Shepherd
Provides a way to represent the current object as a string.
Definition istringable.h:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [18/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( size_type  count,
value_type  ch 
)
inline

Appends additional characters to the string.

Parameters
countThe number of characters to append.
chThe character value to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Appends count copies of character ch.
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [19/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( const basic_string_builder< char_t, traits_t, allocator_t > &  str)
inline

Appends additional characters to the string.

Parameters
strThe string to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Appends string str.
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [20/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( const basic_string_builder< char_t, traits_t, allocator_t > &  str,
size_type  pos 
)
inline

Appends additional characters to the string.

Parameters
strThe string to append.
posThe index of the first character to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Appends a substring [pos, pos + count) of str.
If the requested substring lasts past the end of the string, or if count == npos, the appended substring is [pos, size()).
If pos > str.size(), std::out_of_range is thrown.
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [21/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( const basic_string_builder< char_t, traits_t, allocator_t > &  str,
size_type  pos,
size_type  count 
)
inline

Appends additional characters to the string.

Parameters
strThe string to append.
posThe index of the first character to append.
countThe number of characters to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Appends a substring [pos, pos + count) of str.
If the requested substring lasts past the end of the string, or if count == npos, the appended substring is [pos, size()).
If pos > str.size(), std::out_of_range is thrown.
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [22/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( const_pointer  s,
size_type  count 
)
inline

Appends additional characters to the string.

Parameters
sThe pointer to the character string to append.
countThe number of characters to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Appends characters in the range [s, s + count). This range can contain null characters.
If [s, s + count) is not a valid range, the behavior is undefined.
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [23/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( const_pointer  s)
inline

Appends additional characters to the string.

Parameters
sThe pointer to the character string to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Appends the null-terminated character string pointed to by s, as if by append(s, traits_t::length(s)).
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append() [24/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
template<class input_iterator_t >
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( input_iterator_t  first,
input_iterator_t  last 
)
inline

Appends additional characters to the string.

Parameters
firstThe first iterator of the range of characters to append.
lastThe last iterator of the range of characters to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Appends characters in the range [first, last).
This overload only participates in overload resolution if input_iterator_t qualifies as a LegacyInputIterator.
The capacity of this instance is adjusted as needed.

◆ append() [25/25]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append ( std::initializer_list< value_type ilist)
inline

Appends additional characters to the string.

Parameters
ilistThe initializer list with the characters to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Appends characters from the initializer list ilist.
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append_format()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
template<typename ... args_t>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append_format ( const xtd::basic_string< char_t > &  format,
args_t &&...  args 
)
inline

Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a corresponding argument in a parameters.

Template Parameters
...args_tTypes of the values to format.
Parameters
formatA composite format string.
argsArguments to format.
Returns
A reference to this instance with format appended. Each format item in format is replaced by the string representation of the corresponding object argument.
Exceptions
xtd::format_exception`format` is invalid.
Remarks
This method uses the composite formatting feature of the xtd framework to convert the value of an object to its text representation and embed that representation in the current xtd::text::basic_string_builder object.
The format parameter consists of optional zero or more runs of text intermixed with zero or more indexed placeholders, called format items, that correspond to objects in the parameter list of this method. The formatting process replaces each format item with the string representation of the corresponding object.
The syntax of a format item is as follows: {[index][,length][:format_string]}
Elements in square brackets are optional. The following table describes each element.
Element  Description
index The optional zero-based position in the parameter list of the object to be formatted. If there is no parameter in the index position, a xtd::format_exception is thrown.
length The minimum number of characters in the string representation of the parameter. If positive, the parameter is right-aligned; if negative, it is left-aligned.
:format_string A standard or custom format string that is supported by the parameter.
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append_join() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
template<typename collection_t >
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append_join ( const xtd::basic_string< char_t > &  separator,
const collection_t &  values 
)
inline

Concatenates and appends the members of a collection, using the specified separator between each member.

Parameters
separatorThe string to use as a separator. separator is included in the concatenated and appended strings only if values has more than one element.
valuesA collection that contains the objects to concatenate and append to the current instance of the string builder.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append_join() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
template<typename collection_t >
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append_join ( value_type  separator,
const collection_t &  values 
)
inline

Concatenates and appends the members of a collection, using the specified xtd::basic_string_builder::value_type separator between each member.

Parameters
separatorThe xtd::basic_string_builder::value_type to use as a separator. separator is included in the concatenated and appended strings only if values has more than one element.
valuesA collection that contains the objects to concatenate and append to the current instance of the string builder.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append_line() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append_line ( )
inline

Appends the default line terminator to the end of the current xtd::text::basic_string_builder object.

Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ append_line() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::append_line ( const xtd::basic_string< char_t > &  value)
inline

Appends a copy of the specified string followed by the default line terminator to the end of the current xtd::text::basic_string_builder object.

Parameters
valueThe string to append.
Returns
A reference to this instance after the append operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
The capacity of this instance is adjusted as needed.
Notes to Callers
When you instantiate the xtd::text::basic_string_builder object by calling the xtd::text::basic_string_builder::basic_string_builder(xtd::size, xtd::size) constructor, both the length and the capacity of the xtd::text::basic_string_builder instance can grow beyond the value of its xtd::text::basic_string_builder::max_capacity property. This can occur particularly when you call the xtd::text::basic_string_builder::append and xtd::text::basic_string_builder::append_format methods to append small strings.

◆ at() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
const_reference xtd::text::basic_string_builder< 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.

◆ at() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
reference xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::at ( size_type  pos)
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.

◆ clear()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::clear ( )
inline

Removes all characters from the current xtd::text::basic_string_builder instance.

Returns
An object whose xtd::text::basic_string_builder::length is 0 (zero).
Remarks
xtd::text::basic_string_builder::clear is a convenience method that is equivalent to setting the xtd::text::basic_string_builder::length property of the current instance to 0 (zero).
All pointers, references, and iterators are invalidated.

◆ compare() [1/7]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
int32 xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::compare ( const basic_string_builder< 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/7]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
int32 xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::compare ( size_type  pos1,
size_type  count1,
const basic_string_builder< 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/7]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
int32 xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::compare ( size_type  pos1,
size_type  count1,
const basic_string_builder< 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/7]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
int32 xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::compare ( size_type  pos1,
size_type  count1,
const basic_string_builder< 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/7]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
int32 xtd::text::basic_string_builder< 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/7]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
int32 xtd::text::basic_string_builder< 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/7]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
int32 xtd::text::basic_string_builder< 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

◆ copy() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::copy ( pointer  dest,
size_type  count 
) const
inline

Copies a substring [pos, pos + count) to character string pointed to by dest. If the requested substring lasts past the end of the string, or if count == npos, the copied substring is [pos, size()).

Parameters
destThe pointer to the destination character string.
countlength of the substring.
Returns
The number of characters copied.
Remarks
The resulting character string is not null-terminated.

◆ copy() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::copy ( pointer  dest,
size_type  count,
size_type  pos 
) const
inline

Copies a substring [pos, pos + count) to character string pointed to by dest. If the requested substring lasts past the end of the string, or if count == npos, the copied substring is [pos, size()).

Parameters
destThe pointer to the destination character string.
countlength of the substring.
posThe position of the first character to include.
Returns
The number of characters copied.
Remarks
The resulting character string is not null-terminated.

◆ copy_to()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
void xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::copy_to ( xtd::size  source_index,
xtd::array< value_type > &  destination,
xtd::size  destination_index,
xtd::size  destination_count 
) const
inline

Copies the characters from a specified segment of this instance to a specified segment of a destination xtd::text::basic_string_builder::value_type array.

Parameters
source_indexThe starting position in this instance where characters will be copied from. The index is zero-based.
destinationThe array where characters will be copied.
destination_indexThe starting position in destination where characters will be copied. The index is zero-based.
destination_countThe number of characters to be copied.
Exceptions
xtd::argument_out_of_range_exception`source_index` is greater than length
-or-
`destination_index` + 'destination_count' greater than destination size.
Remarks
The xtd::text::basic_string_builder::copy_to method is intended to be used in the rare situation when you need to efficiently copy successive sections of a xtd::text::basic_string_builder object to an array. The array should be a fixed size, preallocated, reusable, and possibly globally accessible.
For example, your code could populate a xtd::text::basic_string_builder object with a large number of characters then use the xtd::text::basic_string_builder::copy_to method to copy small, successive pieces of the xtd::text::basic_string_builder object to an array where the pieces are processed. When all the data in the xtd::text::basic_string_builder object is processed, the size of the xtd::text::basic_string_builder object is set to zero and the cycle is repeated.

◆ equals() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
bool xtd::text::basic_string_builder< 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::text::basic_string_builder object, have the same value.

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

Reimplemented from xtd::object.

◆ equals() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
bool xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::equals ( const basic_string_builder< char_t, traits_t, allocator_t > &  value) const
inlineoverridenoexcept

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

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

◆ ensure_capacity()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::ensure_capacity ( size_type  capacity)
inline

Ensures that the capacity of this instance of xtd::text::basic_string_builder is at least the specified value.

Parameters
capacityThe minimum capacity to ensure.
Returns
The new capacity of this instance.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed Enlarging the value of this instance would exceed MaxCapacity.max_capacity.
Remarks
If the current capacity is less than the capacity parameter, memory for this instance is reallocated to hold at least capacity number of characters; otherwise, no memory is changed.

◆ erase() [1/5]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::erase ( )
inline

Removes specified characters from the string.

Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Removes std::min(count, size() - index) characters starting at index.

◆ erase() [2/5]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::erase ( size_type  index)
inline

Removes specified characters from the string.

Parameters
indexThe first character to remove.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Removes std::min(count, size() - index) characters starting at index.

◆ erase() [3/5]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::erase ( size_type  index,
size_type  count 
)
inline

Removes specified characters from the string.

Parameters
indexThe first character to remove.
countThe number of characters to remove.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Removes std::min(count, size() - index) characters starting at index.

◆ erase() [4/5]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::erase ( const_iterator  position)
inline

Removes specified characters from the string.

Parameters
positionThe iterator to the character to remove.
Returns
The Iterator pointing to the character immediately following the character erased, or end() if no such character exists.
Remarks
Removes the character at position.
If position is not a dereferenceable iterator on *this, the behavior is undefined.

◆ erase() [5/5]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::erase ( const_iterator  first,
const_iterator  last 
)
inline

Removes specified characters from the string.

Parameters
firstThe first iterator of the range of the characters to remove.
lastThe last iterator of the range of the characters to remove.
Returns
The iterator pointing to the character last pointed to before the erase, or end() if no such character exists.
Remarks
Removes the characters in the range [first, last).
If first or last is not a valid iterator on *this, or [first, last) is not a valid range, the behavior is undefined.

◆ find() [1/7]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find ( const basic_string_builder< 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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find ( const basic_string_builder< 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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_first_of ( const basic_string_builder< 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::text::basic_string_builder::npos will be returned.

Parameters
strThe string identifying characters to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_first_of ( const basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::npos will be returned.

Parameters
sThe pointer to a character string identifying characters to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_first_of ( value_type  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::text::basic_string_builder::npos will be returned.

Parameters
chThe character to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_first_of ( value_type  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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_first_not_of ( const basic_string_builder< 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::text::basic_string_builder::npos will be returned.

Parameters
strThe string identifying characters to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_first_not_of ( const basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::npos will be returned.

Parameters
sThe pointer to a character string identifying characters to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_first_not_of ( value_type  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::text::basic_string_builder::npos will be returned.

Parameters
chThe character to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_first_not_of ( value_type  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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_last_of ( const basic_string_builder< 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::text::basic_string_builder::npos will be returned.

Parameters
strThe string identifying characters to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_last_of ( const basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::npos will be returned.

Parameters
sThe pointer to a character string identifying characters to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_last_of ( value_type  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::text::basic_string_builder::npos will be returned.

Parameters
chThe character to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_last_of ( value_type  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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_last_not_of ( const basic_string_builder< 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::text::basic_string_builder::npos will be returned.

Parameters
strThe string identifying characters to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_last_not_of ( const basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::npos will be returned.

Parameters
sThe pointer to a character string identifying characters to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_last_not_of ( value_type  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::text::basic_string_builder::npos will be returned.

Parameters
chThe character to search for.
Returns
Position of the found character or xtd::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::find_last_not_of ( value_type  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::text::basic_string_builder::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::text::basic_string_builder::npos if no such character is found.
Remarks
Finds the first character equal to ch.

◆ get_allocator()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
allocator_type xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
virtual const base_type & xtd::text::basic_string_builder< 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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::size xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::get_hash_code ( ) const
inlineoverridevirtualnoexcept

Returns the hash code for this basic_string_builder.

Returns
A hash code.

Reimplemented from xtd::object.

◆ insert() [1/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
const xtd::basic_string< char_t > &  value 
)
inline

Inserts a string into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe string to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [2/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
const xtd::basic_string< char_t > &  value,
size_type  count 
)
inline

Inserts one or more copies of a specified string into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe string to insert.
countThe number of times to insert value.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [3/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
xtd::boolean  value 
)
inline

Inserts the string representation of a boolean value into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [4/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
xtd::byte  value 
)
inline

Inserts the string representation of a specified 8-bit unsigned integer into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [5/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
xtd::decimal  value 
)
inline

Inserts the string representation of a specified 8decimal into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [6/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
double  value 
)
inline

Inserts the string representation of a specified double into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [7/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
xtd::single  value 
)
inline

Inserts the string representation of a specified single into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [8/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
xtd::int16  value 
)
inline

Inserts the string representation of a specified 16-bit signed integer into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [9/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
xtd::int32  value 
)
inline

Inserts the string representation of a specified 32-bit signed integer into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [10/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
xtd::int64  value 
)
inline

Inserts the string representation of a specified 64-bit signed integer into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [11/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
xtd::sbyte  value 
)
inline

Inserts the string representation of a specified 8-bit signed integer into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [12/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
xtd::uint16  value 
)
inline

Inserts the string representation of a specified 16-bit unsigned integer into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionEnlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [13/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
xtd::uint32  value 
)
inline

Inserts the string representation of a specified 32-bit unsigned integer into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [14/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
xtd::uint64  value 
)
inline

Inserts the string representation of a specified 64-bit unsigned integer into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [15/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
value_type  value 
)
inline

Inserts the string representation of a specified Unicode character into this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [16/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
value_type  value,
size_type  repeat_count 
)
inline

Inserts a specified number of copies of the string representation of a Unicode character to this instance at the specified character position.

Parameters
indexThe position in this instance where insertion begins.
valueThe character to insert.
repeat_countThe number of times to append value.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [17/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
template<typename object_t >
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
object_t  value 
)
inline

Inserts the string representation of a specified object into this instance at the specified character position.

Template Parameters
object_tThe type of object to insert.
Parameters
indexThe position in this instance where insertion begins.
valueThe value to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Existing characters are shifted to make room for the new text. The capacity is adjusted as needed.
This instance of xtd::text::basic_string_builder is not changed if value is empty (its length is zero).
Notes to Callers
Calls to this method threw an xtd::argument_out_of_range_exception if inserting value would cause the object's total length to exceed xtd::text::basic_string_builder::max_capacity.

◆ insert() [18/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
size_type  count,
value_type  ch 
)
inline

Inserts characters into the string.

Parameters
indexThe position at which the content will be inserted.
countThe number of characters to insert.
chThe character to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Inserts count copies of character ch at the position index.

◆ insert() [19/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
const_pointer  s 
)
inline

Inserts characters into the string.

Parameters
indexThe position at which the content will be inserted.
sThe pointer to the character string to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Inserts null-terminated character string pointed to by s at the position index. The length of the string is determined by the first null character using `traits_t::length(s).

◆ insert() [20/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
const_pointer  s,
size_type  count 
)
inline

Inserts characters into the string.

Parameters
indexThe position at which the content will be inserted.
sThe pointer to the character string to insert.
countThe number of characters to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Inserts the characters in the range [s, s + count) at the position index. The range can contain null characters.

◆ insert() [21/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
const basic_string_builder< char_t, traits_t, allocator_t > &  str 
)
inline

Inserts characters into the string.

Parameters
indexThe position at which the content will be inserted.
strThe string to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Inserts string str at the position index.

◆ insert() [22/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
const basic_string_builder< char_t, traits_t, allocator_t > &  str,
size_type  s_index,
size_type  count 
)
inline

Inserts characters into the string.

Parameters
indexThe position at which the content will be inserted.
strThe string to insert.
s_indexThe position of the first character in str to insert.
countThe number of characters to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Inserts a string, obtained by str.substr(s_index, count) at the position `index.

◆ insert() [23/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( size_type  index,
const basic_string_builder< char_t, traits_t, allocator_t > &  str,
size_type  s_index 
)
inline

Inserts characters into the string.

Parameters
indexThe position at which the content will be inserted.
strThe string to insert.
s_indexThe position of the first character in str to insert.
Returns
A reference to this instance after the insert operation has completed.
Exceptions
xtd::argument_out_of_range_exception`index` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Inserts a string, obtained by str.substr(s_index, str.length()) at the position `index.

◆ insert() [24/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( const_iterator  pos,
value_type  ch 
)
inline

Inserts characters into the string.

Parameters
posThe iterator before which the characters will be inserted.
chThe character to insert.
Returns
An iterator which refers to the copy of the first inserted character or pos if no characters were inserted (count == 0 or first == last or ilist.size() == 0)
Exceptions
xtd::argument_out_of_range_exception`pos` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Inserts character ch before the character pointed by pos.

◆ insert() [25/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( const_iterator  pos,
size_type  count,
value_type  ch 
)
inline

Inserts characters into the string.

Parameters
posThe iterator before which the characters will be inserted.
countThe number of characters to insert.
chThe character to insert.
Returns
An iterator which refers to the copy of the first inserted character or pos if no characters were inserted (count == 0 or first == last or ilist.size() == 0)
Exceptions
xtd::argument_out_of_range_exception`pos` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Inserts count copies of character ch before the element (if any) pointed by pos.

◆ insert() [26/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
template<typename input_iterator_t >
iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( const_iterator  pos,
input_iterator_t  first,
input_iterator_t  last 
)
inline

Inserts characters into the string.

Parameters
posThe iterator before which the characters will be inserted.
firstThe firs position of range defining characters to insert.
lastThe last position of range defining characters to insert.
Returns
An iterator which refers to the copy of the first inserted character or pos if no characters were inserted (count == 0 or first == last or ilist.size() == 0)
Exceptions
xtd::argument_out_of_range_exception`pos` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Inserts characters from the range [first, last) before the element (if any) pointed by pos, as if by insert(pos - begin(), basic_string(first, last, get_allocator())).
This overload does not participate in overload resolution if input_iterator_t does not satisfy LegacyInputIterator.

◆ insert() [27/27]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
iterator xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::insert ( const_iterator  pos,
std::initializer_list< value_type ilist 
)
inline

Inserts characters into the string.

Parameters
posThe iterator before which the characters will be inserted.
ilistThe std::initializer_list to insert the characters from
Returns
An iterator which refers to the copy of the first inserted character or pos if no characters were inserted (count == 0 or first == last or ilist.size() == 0)
Exceptions
xtd::argument_out_of_range_exception`pos` is greater than the length of this instance.<rr>-or-
Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity.
Remarks
Inserts elements from initializer list ilist before the element (if any) pointed by pos.

◆ pop_back()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
void xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::pop_back ( )
inline

Removes the last character from the string.

Remarks
Equivalent to erase(end() - 1). The behavior is undefined if the string is empty.

◆ push_back()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
void xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::push_back ( value_type  ch)
inline

Appends the given character ch to the end of the string.

Parameters
chThe character to append.

◆ remove()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::remove ( size_type  start_index,
size_type  length 
)
inline

Removes the specified range of characters from this instance.

Parameters
start_indexThe zero-based position in this instance where removal begins.
lengthThe number of characters to remove.
Returns
A reference to this instance after the excise operation has completed.
Exceptions
xtd::argument_out_of_range_exceptionIf `start_index` + `length` is greater than the length of this instance.
Remarks
The current method removes the specified range of characters from the current instance. The characters at (start_index + length) are moved to start_index, and the string value of the current instance is shortened by length. The capacity of the current instance is unaffected.
Warning
The xtd::text::basic_string_builder::remove method modifies the value of the current xtd::text::basic_string_builder instance and returns that instance. It does not create and return a new xtd::text::basic_string_builder object.

◆ replace() [1/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( value_type  old_char,
value_type  new_char 
)
inlinenoexcept

Replaces all occurrences of a specified character in this instance with another specified character.

Parameters
old_charThe character to replace.
new_charThe character that replaces old_char.
Returns
A reference to this instance with old_char replaced by new_char.
Remarks
This method performs an ordinal, case-sensitive comparison to identify occurrences of old_char in the current instance. The size of the current xtd::text::basic_string_builder instance is unchanged after the replacement.

◆ replace() [2/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( value_type  old_char,
value_type  new_char,
size_type  start_index,
size_type  count 
)
inline

Replaces, within a substring of this instance, all occurrences of a specified character with another specified character.

Parameters
old_charThe character to replace.
new_charThe character that replaces old_char.
start_indexThe position in this instance where the substring begins.
countThe length of the substring.
Returns
A reference to this instance with old_char replaced by new_char in the range from start_ index to start_index + count - 1.
Remarks
This method performs an ordinal, case-sensitive comparison to identify occurrences of old_char in the current instance. The size of the current xtd::text::basic_string_builder object is unchanged after the replacement.

◆ replace() [3/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( const xtd::basic_string< char_t > &  old_value,
const xtd::basic_string< char_t > &  new_value 
)
inlinenoexcept

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

Parameters
old_valueThe string to replace.
new_valueThe string that replaces 'old_value. @return A reference to this instance with all instances ofold_valuereplaced bynew_value. @exception xtd::argument_out_of_range_exception Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. @remarks This method performs an ordinal, case-sensitive comparison to identify occurrences ofold_valuein the current instance. Ifnew_valueis xtd::basic_string::empty_string, all occurrences ofold_value` are removed.

◆ replace() [4/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( const xtd::basic_string< char_t > &  old_value,
const xtd::basic_string< char_t > &  new_value,
size_type  start_index,
size_type  count 
)
inline

Replaces, within a substring of this instance, all occurrences of a specified string with another specified string.

Parameters
old_valueThe string to replace.
new_valueThe string that replaces 'old_value. @param start_index The position in this instance where the substring begins. @param count The length of the substring. @return A reference to this instance with all instances ofold_valuereplaced bynew_valuein the range fromstart_indextostart_index+count- 1. @exception xtd::argument_out_of_range_exceptionstart_indexpluscountindicates a character position not within this instance.<br>-or-<br>Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. @remarks This method performs an ordinal, case-sensitive comparison to identify occurrences ofold_valuein the substring of this current instance. Ifnew_valueis xtd::basic_string::empty_string, all occurrences ofold_value` are removed.

◆ replace() [5/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( size_type  pos,
size_type  count,
const basic_string_builder< char_t, traits_t, allocator_t > &  str 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
posThe start of the substring that is going to be replaced.
countThe length of the substring that is going to be replaced.
strThe string to use for replacement.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with str.

◆ replace() [6/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( const_iterator  first,
const_iterator  last,
const basic_string_builder< char_t, traits_t, allocator_t > &  str 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
firstThe first itrator of range of characters that is going to be replaced.
lastThe last itrator of range of characters that is going to be replaced.
strThe string to use for replacement.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with str.
If [begin(), first) or [first, last`) is not a valid range, the behavior is undefined.

◆ replace() [7/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( size_type  pos,
size_type  count,
const basic_string_builder< char_t, traits_t, allocator_t > &  str,
size_type  pos2 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
posThe start of the substring that is going to be replaced.
countThe length of the substring that is going to be replaced.
strThe string to use for replacement.
pos2The start of the substring to replace with.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with a substring [pos2, std::min(pos2 + count2, str.size())) of str.

◆ replace() [8/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( size_type  pos,
size_type  count,
const basic_string_builder< char_t, traits_t, allocator_t > &  str,
size_type  pos2,
size_type  count2 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
posThe start of the substring that is going to be replaced.
countThe length of the substring that is going to be replaced.
strThe string to use for replacement.
pos2The start of the substring to replace with.
count2The number of characters to replace with.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with a substring [pos2, std::min(pos2 + count2, str.size())) of str.

◆ replace() [9/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( size_type  pos,
size_type  count,
const_pointer  cstr,
size_type  count2 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
posThe start of the substring that is going to be replaced.
countThe length of the substring that is going to be replaced.
cstrThe pointer to the character string to use for replacement.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with the characters in the range [cstr, cstr + count2).
If [cstr, cstr + count2) is not a valid range, the behavior is undefined.

◆ replace() [10/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( const_iterator  first,
const_iterator  last,
const_pointer  cstr,
size_type  count2 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
firstThe first itrator of range of characters that is going to be replaced.
lastThe last itrator of range of characters that is going to be replaced.
cstrThe pointer to the character string to use for replacement.
count2The number of characters to replace with.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with the characters in the range [cstr, cstr + count2).
If [cstr, cstr + count2) is not a valid range, the behavior is undefined.
If [begin(), first) or [first, last`) is not a valid range, the behavior is undefined.

◆ replace() [11/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( size_type  pos,
size_type  count,
const_pointer  cstr 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
posThe start of the substring that is going to be replaced.
countThe length of the substring that is going to be replaced.
cstrThe pointer to the character string to use for replacement.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with the characters in the range [cstr, cstr + Traits::length(cstr)).

◆ replace() [12/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( const_iterator  first,
const_iterator  last,
const_pointer  cstr 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
firstThe first itrator of range of characters that is going to be replaced.
lastThe last itrator of range of characters that is going to be replaced.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with the characters in the range [cstr, cstr + Traits::length(cstr)).
If [begin(), first) or [first, last`) is not a valid range, the behavior is undefined.

◆ replace() [13/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( size_type  pos,
size_type  count,
size_type  count2,
value_type  ch 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
posThe start of the substring that is going to be replaced.
countThe length of the substring that is going to be replaced.
count2The number of characters to replace with.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with count2 copies of ch.

◆ replace() [14/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( const_iterator  first,
const_iterator  last,
size_type  count2,
value_type  ch 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
firstThe first itrator of range of characters that is going to be replaced.
lastThe last itrator of range of characters that is going to be replaced.
count2The number of characters to replace with.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with count2 copies of ch.
If [begin(), first) or [first, last`) is not a valid range, the behavior is undefined.

◆ replace() [15/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
template<typename input_iterator_t >
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( const_iterator  first,
const_iterator  last,
input_iterator_t  first2,
input_iterator_t  last2 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
firstThe first itrator of range of characters that is going to be replaced.
lastThe last itrator of range of characters that is going to be replaced.
first2The first itrator of range of characters to use for replacement.
last2The last itrator of range of characters to use for replacement.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with the characters in the range [first2, last2) as if by replace(first, last, basic_string(first2, last2, get_allocator())).
If [begin(), first) or [first, last`) is not a valid range, the behavior is undefined.

◆ replace() [16/16]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::replace ( const_iterator  first,
const_iterator  last,
std::initializer_list< value_type ilist 
)
inline

Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.

Parameters
firstThe first itrator of range of characters that is going to be replaced.
lastThe last itrator of range of characters that is going to be replaced.
ilistThe initializer list with the characters to use for replacement.
Returns
This current instance of xtd::text::basic_string_builder.
Remarks
Those characters are replaced with the characters in ilist.
If [begin(), first) or [first, last`) is not a valid range, the behavior is undefined.

◆ reserve()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
void xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::reserve ( size_type  new_cap)
inline

Informs a xtd::text::basic_string_builder object of a planned change in size, so that it can manage the storage allocation appropriately.

Parameters
new_capThe new capacity of the string.
Remarks
If new_cap is greater than the current capacity(), new storage is allocated, and capacity() is made equal or greater than new_cap.
If new_cap is less than or equal to the current capacity(), there is no effect.
If a capacity change takes place, all iterators and references, including the past-the-end iterator, are invalidated.

◆ resize() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
void xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::resize ( size_type  count)
inline

Resizes the string to contain count characters.

Parameters
countThe new size of the string.
Remarks
If the current size is less than count, additional characters are appended:
Initializes appended characters to value_type() ('\0' if value_type is char).

◆ resize() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
void xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::resize ( size_type  count,
value_type  ch 
)
inline

Resizes the string to contain count characters.

Parameters
countThe new size of the string.
chThe character to initialize the new characters with.
Remarks
If the current size is less than count, additional characters are appended:
Initializes appended characters to ch.

◆ rfind() [1/7]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::rfind ( const basic_string_builder< 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::text::basic_string_builder::nposand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following xtd::text::basic_string_builder::npos). If xtd::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::size() - 1 is passed as xtd::text::basic_string_builder::npos, the whole string will be searched. @return Position of the first character of the found substring or xtd::text::basic_string_builder::npos if no such substring is found. @remarks Finds the first substring equal tostr`.

◆ rfind() [2/7]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::rfind ( const basic_string_builder< 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::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::nposand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following xtd::text::basic_string_builder::npos). If xtd::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::size() - 1 is passed as xtd::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::nposand proceeds from right to left (thus, the found substring, if any, cannot begin in a position following xtd::text::basic_string_builder::npos). If xtd::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::size() - 1 is passed as xtd::text::basic_string_builder::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::text::basic_string_builder::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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
size_type xtd::text::basic_string_builder< 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::text::basic_string_builder::npos or any value not smaller than xtd::text::basic_string_builder::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::text::basic_string_builder::npos if no such substring is found.
Remarks
Finds the first character ch (treated as a single-character substring by the formal rules below).

◆ shrink_to_fit()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
void xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::shrink_to_fit ( )
inline

Requests the removal of unused capacity.

Remarks
It is a non-binding request to reduce capacity() to size(). It depends on the implementation if the request is fulfilled.
If (and only if) reallocation takes place, all pointers, references, and iterators are invalidated.

◆ substr() [1/3]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder xtd::text::basic_string_builder< 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::text::basic_string_builder::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_builder(*this, pos, count);.

◆ substr() [2/3]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder xtd::text::basic_string_builder< 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::text::basic_string_builder::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_builder(*this, pos, count);.

◆ substr() [3/3]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder xtd::text::basic_string_builder< 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::text::basic_string_builder::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_builder(*this, pos, count);.

◆ swap()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
void xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::swap ( basic_string_builder< char_t, traits_t, allocator_t > &  other)
inlinenoexcept

Exchanges the contents of the string with those of other. All iterators and references may be invalidated.

Parameters
otherThe string to exchange the contents with.

◆ to_string()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::string xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::to_string ( ) const
inlineoverridevirtualnoexcept

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

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

Reimplemented from xtd::object.

◆ operator[]() [1/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
const_reference xtd::text::basic_string_builder< 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[]() [2/2]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
reference xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator[] ( xtd::size  index)
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 = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< 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 base_type &()

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator base_type & ( )
inlinenoexcept

Returns a reference to the underlying base type.

Returns
Reference to the underlying base type.

◆ operator=() [1/9]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator= ( const basic_string_builder< char_t, traits_t, allocator_t > &  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/9]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator= ( basic_string_builder< char_t, traits_t, allocator_t > &&  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=() [3/9]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator= ( const std::basic_string< value_type > &  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/9]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator= ( std::basic_string< value_type > &&  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/9]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator= ( const xtd::basic_string< value_type > &  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/9]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator= ( xtd::basic_string< value_type > &&  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=() [7/9]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator= ( const_pointer  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=() [8/9]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator= ( value_type  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=() [9/9]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator= ( const std::initializer_list< value_type > &  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/4]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator+= ( const basic_string_builder< char_t, traits_t, allocator_t > &  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [2/4]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator+= ( basic_string_builder< char_t, traits_t, allocator_t > &&  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [3/4]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator+= ( const_pointer  str)
inline

Addition assignment operator. Appends additional characters to the string.

Parameters
strstring to append.
Returns
This current instance with characters added.

◆ operator+=() [4/4]

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
basic_string_builder & xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::operator+= ( value_type  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

◆ npos

template<typename char_t , typename traits_t = std::char_traits<char_t>, typename allocator_t = xtd::collections::generic::helpers::allocator<char_t>>
constexpr size_type xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::npos
inlinestaticconstexpr

This is a special value equal to the maximum value representable by the type xtd::size.


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