Represents a mutable string of characters. This class cannot be inherited.
Public Aliases | |
| using | base_type |
| Represents the basic string base type. | |
| using | traits_type |
| Represents the basic string traits type. | |
| using | value_type |
| Represents the basic string value type. | |
| using | allocator_type |
| Represents the basic string allocator type. | |
| using | size_type |
| Represents the basic string size type. | |
| using | difference_type |
| Represents the basic string difference type. | |
| using | reference |
| Represents the basic string referecne type. | |
| using | const_reference |
| Represents the basic string const referecne type. | |
| using | pointer |
| Represents the basic string pointer type. | |
| using | const_pointer |
| Represents the basic string const pointer type. | |
| using | iterator |
| Represents the basic string iterator type. | |
| using | const_iterator |
| Represents the basic string const iterator type. | |
| using | reverse_iterator |
| Represents the basic string reverse iterator type. | |
| using | const_reverse_iterator |
| Represents the basic string const reverse iterator type. | |
Public Fields | |
| static constexpr size_type | npos |
| Represents a value that is not a valid position in a collection. | |
| static constexpr xtd::size | bpos |
| Represents the index of the first valid element in a collection. | |
| static constexpr xtd::size | epos |
| Represents the index of the last valid element in a collection. | |
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<class 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<class 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 | |
| auto | begin () const -> const_iterator |
| Returns an iterator to the first character of the string. | |
| auto | begin () -> iterator |
| Returns an iterator to the first character of the string. | |
| auto | c_str () const noexcept -> const_pointer |
| Returns a pointer to a null-terminated character array with data equivalent to those stored in the string. | |
| auto | capacity () const noexcept -> size_type |
| Returns the number of characters that the string has currently allocated space for. | |
| auto | capacity (size_type value) -> basic_string_builder & |
| Sets the number of characters that the string has currently allocated space for. | |
| auto | cbegin () const -> const_iterator |
| Returns an iterator to the first character of the string. | |
| auto | chars () const noexcept -> const base_type & |
| Returns a reference to the underlying base type. | |
| auto | chars () noexcept -> base_type & |
| Returns a reference to the underlying base type. | |
| auto | cend () const -> const_iterator |
| 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. | |
| auto | data () const noexcept -> const_pointer |
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. | |
| auto | data () noexcept -> pointer |
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. | |
| auto | empty () const noexcept -> bool |
Checks if the string has no characters, i.e. whether begin() == end(). | |
| auto | end () const -> const_iterator |
| 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. | |
| auto | end () -> iterator |
| 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. | |
| auto | length () const noexcept -> size_type |
| Gets or sets the length of the current xtd::text::basic_string_builder object. | |
| auto | length (size_type value) noexcept -> basic_string_builder & |
| Sets or sets the length of the current xtd::text::basic_string_builder object. | |
| auto | max_capacity () const noexcept -> size_type |
| Returns the number of characters that the string has currently allocated space for. | |
| auto | size () const noexcept -> size_type |
Returns the number of char_t elements in the string, i.e. std::distance(begin(), end()). | |
Public Methods | |
| auto | append (const xtd::basic_string< char_t > &value) -> basic_string_builder & |
| Appends a copy of the specified string to this instance. | |
| auto | append (const xtd::basic_string< char_t > &value, size_type start_index, size_type count) -> basic_string_builder & |
| Appends a copy of a specified substring to this instance. | |
| auto | append (xtd::boolean value) -> basic_string_builder & |
| Appends the string representation of a specified boolean value to this instance. | |
| auto | append (xtd::byte value) -> basic_string_builder & |
| Appends the string representation of a specified 8-bit unsigned value to this instance. | |
| auto | append (xtd::decimal value) -> basic_string_builder & |
| Appends the string representation of a specified decimal value to this instance. | |
| auto | append (double value) -> basic_string_builder & |
| Appends the string representation of a specified double value to this instance. | |
| auto | append (xtd::single value) -> basic_string_builder & |
| Appends the string representation of a specified single value to this instance. | |
| auto | append (xtd::int16 value) -> basic_string_builder & |
| Appends the string representation of a specified 16-bit signed integer value to this instance. | |
| auto | append (xtd::int32 value) -> basic_string_builder & |
| Appends the string representation of a specified 32-bit signed integer value to this instance. | |
| auto | append (xtd::int64 value) -> basic_string_builder & |
| Appends the string representation of a specified 64-bit signed integer value to this instance. | |
| auto | append (xtd::sbyte value) -> basic_string_builder & |
| Appends the string representation of a specified 8-bit signed integer value to this instance. | |
| auto | append (xtd::uint16 value) -> basic_string_builder & |
| Appends the string representation of a specified 16-bit unsigned integer value to this instance. | |
| auto | append (xtd::uint32 value) -> basic_string_builder & |
| Appends the string representation of a specified 32-bit unsigned integer value to this instance. | |
| auto | append (xtd::uint64 value) -> basic_string_builder & |
| Appends the string representation of a specified 64-bit unsigned integer value to this instance. | |
| auto | append (value_type value) -> basic_string_builder & |
| Appends the string representation of a specified xtd::text::basic_string_builder::value_type value to this instance. | |
| auto | append (value_type value, size_type repeat_count) -> basic_string_builder & |
| Appends a specified number of copies of the string representation of a Unicode character to this instance. | |
| template<class object_t> | |
| auto | append (object_t value) -> basic_string_builder & |
| Appends the string representation of a specified object to this instance. | |
| auto | append (size_type count, value_type ch) -> basic_string_builder & |
| Appends additional characters to the string. | |
| auto | append (const basic_string_builder &str) -> basic_string_builder & |
| Appends additional characters to the string. | |
| auto | append (const basic_string_builder &str, size_type pos) -> basic_string_builder & |
| Appends additional characters to the string. | |
| auto | append (const basic_string_builder &str, size_type pos, size_type count) -> basic_string_builder & |
| Appends additional characters to the string. | |
| auto | append (const_pointer s, size_type count) -> basic_string_builder & |
| Appends additional characters to the string. | |
| auto | append (const_pointer s) -> basic_string_builder & |
| Appends additional characters to the string. | |
| template<class input_iterator_t> | |
| auto | append (input_iterator_t first, input_iterator_t last) -> basic_string_builder & |
| Appends additional characters to the string. | |
| auto | append (std::initializer_list< value_type > ilist) -> basic_string_builder & |
| Appends additional characters to the string. | |
| template<class ... args_t> | |
| auto | append_format (const xtd::basic_string< char_t > &format, args_t &&... args) -> basic_string_builder & |
| 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<class collection_t> | |
| auto | append_join (const xtd::basic_string< char_t > &separator, const collection_t &values) -> basic_string_builder & |
| Concatenates and appends the members of a collection, using the specified separator between each member. | |
| template<class collection_t> | |
| auto | append_join (value_type separator, const collection_t &values) -> basic_string_builder & |
| Concatenates and appends the members of a collection, using the specified xtd::basic_string_builder::value_type separator between each member. | |
| auto | append_line () -> basic_string_builder & |
| Appends the default line terminator to the end of the current xtd::text::basic_string_builder object. | |
| auto | append_line (const xtd::basic_string< char_t > &value) -> basic_string_builder & |
| 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. | |
| auto | clear () -> basic_string_builder & |
| Removes all characters from the current xtd::text::basic_string_builder instance. | |
| auto | copy_to (xtd::size source_index, xtd::array< value_type > &destination, xtd::size destination_index, xtd::size destination_count) const -> void |
| 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. | |
| auto | equals (const object &obj) const noexcept -> bool override |
| Determines whether this instance and a specified object, which must also be a xtd::text::basic_string_builder object, have the same value. | |
| auto | equals (const basic_string_builder &value) const noexcept -> bool override |
| Determines whether this instance and another specified xtd::text::basic_string_builder object have the same value. | |
| auto | ensure_capacity (size_type capacity) -> size_type |
| Ensures that the capacity of this instance of xtd::text::basic_string_builder is at least the specified value. | |
| virtual auto | get_base_type () const noexcept -> const base_type & |
| Returns the underlying base type. | |
| auto | get_hash_code () const noexcept -> xtd::size override |
| Returns the hash code for this basic_string_builder. | |
| auto | insert (size_type index, const xtd::basic_string< char_t > &value) -> basic_string_builder & |
| Inserts a string into this instance at the specified character position. | |
| auto | insert (size_type index, const xtd::basic_string< char_t > &value, size_type count) -> basic_string_builder & |
| Inserts one or more copies of a specified string into this instance at the specified character position. | |
| auto | insert (size_type index, xtd::boolean value) -> basic_string_builder & |
| Inserts the string representation of a boolean value into this instance at the specified character position. | |
| auto | insert (size_type index, xtd::byte value) -> basic_string_builder & |
| Inserts the string representation of a specified 8-bit unsigned integer into this instance at the specified character position. | |
| auto | insert (size_type index, xtd::decimal value) -> basic_string_builder & |
| Inserts the string representation of a specified 8decimal into this instance at the specified character position. | |
| auto | insert (size_type index, double value) -> basic_string_builder & |
| Inserts the string representation of a specified double into this instance at the specified character position. | |
| auto | insert (size_type index, xtd::single value) -> basic_string_builder & |
| Inserts the string representation of a specified single into this instance at the specified character position. | |
| auto | insert (size_type index, xtd::int16 value) -> basic_string_builder & |
| Inserts the string representation of a specified 16-bit signed integer into this instance at the specified character position. | |
| auto | insert (size_type index, xtd::int32 value) -> basic_string_builder & |
| Inserts the string representation of a specified 32-bit signed integer into this instance at the specified character position. | |
| auto | insert (size_type index, xtd::int64 value) -> basic_string_builder & |
| Inserts the string representation of a specified 64-bit signed integer into this instance at the specified character position. | |
| auto | insert (size_type index, xtd::sbyte value) -> basic_string_builder & |
| Inserts the string representation of a specified 8-bit signed integer into this instance at the specified character position. | |
| auto | insert (size_type index, xtd::uint16 value) -> basic_string_builder & |
| Inserts the string representation of a specified 16-bit unsigned integer into this instance at the specified character position. | |
| auto | insert (size_type index, xtd::uint32 value) -> basic_string_builder & |
| Inserts the string representation of a specified 32-bit unsigned integer into this instance at the specified character position. | |
| auto | insert (size_type index, xtd::uint64 value) -> basic_string_builder & |
| Inserts the string representation of a specified 64-bit unsigned integer into this instance at the specified character position. | |
| auto | insert (size_type index, value_type value) -> basic_string_builder & |
| Inserts the string representation of a specified Unicode character into this instance at the specified character position. | |
| auto | insert (size_type index, value_type value, size_type repeat_count) -> basic_string_builder & |
| Inserts a specified number of copies of the string representation of a Unicode character to this instance at the specified character position. | |
| template<class object_t> | |
| auto | insert (size_type index, object_t value) -> basic_string_builder & |
| Inserts the string representation of a specified object into this instance at the specified character position. | |
| auto | insert (size_type index, size_type count, value_type ch) -> basic_string_builder & |
| Inserts characters into the string. | |
| auto | insert (size_type index, const basic_string_builder &str, size_type s_index, size_type count) -> basic_string_builder & |
| Inserts characters into the string. | |
| auto | replace (const xtd::basic_string< char_t > &old_value, const xtd::basic_string< char_t > &new_value) noexcept -> basic_string_builder & |
| Inserts characters into the string. | |
| auto | replace (const_iterator first, const_iterator last, const basic_string_builder &str) -> basic_string_builder & |
| Replaces, within a substring of this instance, all occurrences of a specified string with another specified string. | |
| auto | replace (size_type pos, size_type count, const basic_string_builder &str, size_type pos2) -> basic_string_builder & |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters. | |
| auto | replace (size_type pos, size_type count, const basic_string_builder &str, size_type pos2, size_type count2) -> basic_string_builder & |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters. | |
| auto | replace (size_type pos, size_type count, const_pointer cstr, size_type count2) -> basic_string_builder & |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters. | |
| auto | replace (const_iterator first, const_iterator last, const_pointer cstr) -> basic_string_builder & |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters. | |
| auto | replace (size_type pos, size_type count, size_type count2, value_type ch) -> basic_string_builder & |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters. | |
| template<class input_iterator_t> | |
| auto | replace (const_iterator first, const_iterator last, input_iterator_t first2, input_iterator_t last2) -> basic_string_builder & |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. | |
| template<class object_t> | |
| xtd::unique_ptr_object< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object. | |
| virtual xtd::string | to_string () const |
| Returns a xtd::string that represents the current object. | |
| virtual bool | equals (const type_t &) const noexcept=0 |
| Indicates whether the current object is equal to another object of the same type. | |
| template<class object_a_t, class object_b_t> | |
| static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal. | |
| template<class object_a_t, class object_b_t> | |
| static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are the same instance. | |
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::base_type |
Represents the basic string base type.
std::basic_string<char_t, traits_t, allocator_t>. | using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::traits_type |
Represents the basic string traits type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::value_type |
Represents the basic string value type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::allocator_type |
Represents the basic string allocator type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::size_type |
Represents the basic string size type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::difference_type |
Represents the basic string difference type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::reference |
Represents the basic string referecne type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::const_reference |
Represents the basic string const referecne type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::pointer |
Represents the basic string pointer type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::const_pointer |
Represents the basic string const pointer type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::iterator |
Represents the basic string iterator type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::const_iterator |
Represents the basic string const iterator type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::reverse_iterator |
Represents the basic string reverse iterator type.
| using xtd::text::basic_string_builder< char_t, traits_t, allocator_t >::const_reverse_iterator |
Represents the basic string const reverse iterator type.
|
default |
Initializes a new instance of xtd::text::basic_string_builder.
|
inline |
Initializes a new instance of the xtd::text::basic_string_builder class using the specified capacity.
| capacity | The suggested starting size of this instance. |
| argument_out_of_range_exception | `capacity` is greater than xtd::text::basic_string_builder::max_capacity. |
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.
|
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.
| capacity | The suggested starting size of the xtd::text::basic_string_builder.. |
| max_capacity | The maximum number of characters the current string can contain. |
| xtd::argument_out_of_range_exception | `capacity` is greater than `max_capacity`. |
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. capacity is zero, the implementation-specific default capacity is used. 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.
|
inline |
Initializes a new instance of the xtd::text::basic_string_builder class using the specified string.
| value | The string used to initialize the value of the instance. |
|
inline |
Initializes a new instance of the xtd::text::basic_string_builder class using the specified string and capacity.
| value | The string used to initialize the value of the instance. |
| capacity | The suggested starting size of the xtd::text::basic_string_builder. |
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.
|
inline |
Initializes a new instance of the xtd::text::basic_string_builder class from the specified substring and capacity.
| value | The string that contains the substring used to initialize the value of this instance. |
| start_index | The position within value where the substring begins. |
| length | The number of characters in the substring. |
| capacity | The suggested starting size of the xtd::text::basic_string_builder. |
| xtd::argument_out_of_range_exception | `start_index` plus `length` is not a position within `value`. |
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.
|
inlineexplicitnoexcept |
Initializes a new instance of xtd::text::basic_string_builder with specified allocator.
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
|
inlinenoexcept |
Initializes a new instance of xtd::text::basic_string_builder with specified string to copy.
| str | The string to copy. |
|
inlinenoexcept |
Initializes a new instance of xtd::text::basic_string_builder with specified string to copy and allocator.
| str | The string to copy. |
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified substring at index.
| str | The string to copy. |
| index | The index of the first substring character where start copy. |
| xtd::index_out_of_range_exception | `index` is greater or equal than `str` size. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified substring at index and allocator.
| str | The string to copy. |
| index | The index of the first substring character where start copy. |
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
| xtd::index_out_of_range_exception | `index` is greater or equal than `str` size. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified substring at index and count characters.
| str | The string to copy. |
| index | The index of the first substring character where start copy. |
| count | The number of substring characters to copy. |
| xtd::index_out_of_range_exception | `index` + `count`is greater or equal than `str` size. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified substring at index, count characters and allocator.
| str | The string to copy. |
| index | The index of the first substring character where start copy. |
| count | The number of substring characters to copy. |
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
| xtd::index_out_of_range_exception | `index` + `count`is greater or equal than `str` size. |
|
inlinenoexcept |
Initializes a new instance of xtd::text::basic_string_builder with specified string to move.
| str | The basic_string_builder to move. |
|
inlinenoexcept |
Initializes a new instance of xtd::text::basic_string_builder with specified string to move and allocator.
| str | The basic_string_builder to move. |
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
|
inline |
| str | The string to copy. |
| count | The number of copies of character. |
| character | The character copied. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified count copies of character and specified allocator.
| count | The number of copies of character. |
| character | The character copied. |
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified count copies of character.
| character | The character copied. |
| count | The number of copies of character. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified count copies of character and specified allocator.
| character | The character copied. |
| count | The number of copies of character. |
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified string to copy.
| str | The string to copy. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified string to copy, and allocator.
| str | The string to copy. |
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified substring and count characters.
| count | The number of substring characters to copy. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified substring, count characters and allocator.
| str | The string to copy. |
| count | The number of substring characters to copy. |
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
|
inlinenoexcept |
Initializes a new instance of xtd::text::basic_string_builder with specified string to copy.
| str | The string to copy. |
|
inlinenoexcept |
Initializes a new instance of xtd::text::basic_string_builder with specified string to copy and allocator.
| str | The string to copy. |
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified first and last iterators of substring.
| first | The first iterator of substring. |
| last | The first iterator of substring. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified first and last iterators of substring and allocator.
| first | The first iterator of substring. |
| last | The first iterator of substring. |
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified initializer list.
| il | The initializer list to fill. |
|
inline |
Initializes a new instance of xtd::text::basic_string_builder with specified initializer list and allocator.
| il | The initializer list to fill. |
| allocator | The allocator to use for all memory allocations of this basic_string_builder. |
|
inlinenodiscard |
Returns an iterator to the first character of the string.
|
inlinenodiscard |
Returns an iterator to the first character of the string.
|
inlinenodiscardnoexcept |
Returns a pointer to a null-terminated character array with data equivalent to those stored in the string.
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.
|
inlinenodiscardnoexcept |
Returns the number of characters that the string has currently allocated space for.
|
inline |
Sets the number of characters that the string has currently allocated space for.
| value | Capacity of the currently allocated storage, i.e. the storage available for storing elements. |
|
inlinenodiscard |
Returns an iterator to the first character of the string.
|
inlinenodiscardnoexcept |
Returns a reference to the underlying base type.
|
inlinenodiscardnoexcept |
Returns a reference to the underlying base type.
|
inlinenodiscard |
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.
|
inlinenodiscardnoexcept |
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.
|
inlinenodiscardnoexcept |
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.
|
inlinenodiscardnoexcept |
|
inlinenodiscard |
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.
|
inlinenodiscard |
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.
|
inlinenodiscardnoexcept |
Gets or sets the length of the current xtd::text::basic_string_builder object.
|
inlinenoexcept |
Sets or sets the length of the current xtd::text::basic_string_builder object.
| value | The length of this instance. |
| xtd::argument_out_of_range_exception | The value specified for a set operation is less than zero or greater than xtd::text::basic_string_builder::max_capacity. |
|
inlinenodiscardnoexcept |
Returns the number of characters that the string has currently allocated space for.
|
inlinenodiscardnoexcept |
|
inline |
Appends a copy of the specified string to this instance.
| value | The string to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
value is empty, no changes are made.
|
inline |
Appends a copy of a specified substring to this instance.
| value | The string that contains the substring to append. |
| start_index | The starting position of the substring within value. |
| count | The number of characters in value to append. |
| xtd::argument_out_of_range_exception | Enlarging 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`. |
value is empty and start_index and count are both zero, no changes are made.
|
inline |
Appends the string representation of a specified boolean value to this instance.
| value | The boolean value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified 8-bit unsigned value to this instance.
| value | The 8-bit unsigned value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified decimal value to this instance.
| value | The decimal value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified double value to this instance.
| value | The double value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified single value to this instance.
| value | The single value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified 16-bit signed integer value to this instance.
| value | The 16-bit signed value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified 32-bit signed integer value to this instance.
| value | The 32-bit signed value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified 64-bit signed integer value to this instance.
| value | The 64-bit signed value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified 8-bit signed integer value to this instance.
| value | The 8-bit signed integer value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified 16-bit unsigned integer value to this instance.
| value | The 16-bit unsigned value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified 32-bit unsigned integer value to this instance.
| value | The 32-bit unsigned value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified 64-bit unsigned integer value to this instance.
| value | The 64-bit unsigned value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified xtd::text::basic_string_builder::value_type value to this instance.
| value | The xtd::text::basic_string_builder::value_type value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends a specified number of copies of the string representation of a Unicode character to this instance.
| value | The character to append. |
| repeat_count | The number of times to append value. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the string representation of a specified object to this instance.
| object_t | The type of object to append. |
| value | The object to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
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.
|
inline |
Appends additional characters to the string.
| count | The number of characters to append. |
| ch | The character value to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
count copies of character ch.
|
inline |
Appends additional characters to the string.
| str | The string to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
str.
|
inline |
Appends additional characters to the string.
| str | The string to append. |
| pos | The index of the first character to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
pos, pos + count) of str. count == npos, the appended substring is [pos, size()). pos > str.length(), std::out_of_range is thrown.
|
inline |
Appends additional characters to the string.
| str | The string to append. |
| pos | The index of the first character to append. |
| count | The number of characters to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
pos, pos + count) of str. count == npos, the appended substring is [pos, size()). pos > str.length(), std::out_of_range is thrown.
|
inline |
Appends additional characters to the string.
| s | The pointer to the character string to append. |
| count | The number of characters to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
s, s + count). This range can contain null characters. s, s + count) is not a valid range, the behavior is undefined.
|
inline |
Appends additional characters to the string.
| s | The pointer to the character string to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
s, as if by append(s, traits_t::length(s)).
|
inline |
Appends additional characters to the string.
| first | The first iterator of the range of characters to append. |
| last | The last iterator of the range of characters to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
first, last). input_iterator_t qualifies as a LegacyInputIterator.
|
inline |
Appends additional characters to the string.
| ilist | The initializer list with the characters to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
ilist.
|
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.
| ...args_t | Types of the values to format. |
| format | A composite format string. |
| args | Arguments to format. |
| xtd::format_exception | `format` is invalid. |
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. {[index][,length][:format_string]} | 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. |
|
inline |
Concatenates and appends the members of a collection, using the specified separator between each member.
| separator | The string to use as a separator. separator is included in the concatenated and appended strings only if values has more than one element. |
| values | A collection that contains the objects to concatenate and append to the current instance of the string builder. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Concatenates and appends the members of a collection, using the specified xtd::basic_string_builder::value_type separator between each member.
| separator | The 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. |
| values | A collection that contains the objects to concatenate and append to the current instance of the string builder. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Appends the default line terminator to the end of the current xtd::text::basic_string_builder object.
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
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.
| value | The string to append. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
|
inline |
Removes all characters from the current xtd::text::basic_string_builder instance.
|
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.
| source_index | The starting position in this instance where characters will be copied from. The index is zero-based. |
| destination | The array where characters will be copied. |
| destination_index | The starting position in destination where characters will be copied. The index is zero-based. |
| destination_count | The number of characters to be copied. |
| xtd::argument_out_of_range_exception | `source_index` is greater than length -or- `destination_index` + 'destination_count' greater than destination size. |
|
inlinenodiscardoverridevirtualnoexcept |
Determines whether this instance and a specified object, which must also be a xtd::text::basic_string_builder object, have the same value.
| obj | The basic_string_builder to compare to this instance. |
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.
|
inlinenodiscardoverridenoexcept |
Determines whether this instance and another specified xtd::text::basic_string_builder object have the same value.
| value | The basic_string_builder to compare to this instance. |
true if the value of the value parameter is the same as the value of this instance; otherwise, false.
|
inline |
Ensures that the capacity of this instance of xtd::text::basic_string_builder is at least the specified value.
| capacity | The minimum capacity to ensure. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed Enlarging the value of this instance would exceed MaxCapacity.max_capacity. |
capacity parameter, memory for this instance is reallocated to hold at least capacity number of characters; otherwise, no memory is changed.
|
inlinenodiscardvirtualnoexcept |
Returns the underlying base type.
|
inlinenodiscardoverridevirtualnoexcept |
Returns the hash code for this basic_string_builder.
Reimplemented from xtd::object.
|
inline |
Inserts a string into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The string to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts one or more copies of a specified string into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The string to insert. |
| count | The number of times to insert value. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a boolean value into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified 8-bit unsigned integer into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified 8decimal into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified double into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified single into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified 16-bit signed integer into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified 32-bit signed integer into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified 64-bit signed integer into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified 8-bit signed integer into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified 16-bit unsigned integer into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| xtd::argument_out_of_range_exception | Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified 32-bit unsigned integer into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified 64-bit unsigned integer into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified Unicode character into this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts a specified number of copies of the string representation of a Unicode character to this instance at the specified character position.
| index | The position in this instance where insertion begins. |
| value | The character to insert. |
| repeat_count | The number of times to append value. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts the string representation of a specified object into this instance at the specified character position.
| object_t | The type of object to insert. |
| index | The position in this instance where insertion begins. |
| value | The value to insert. |
| 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. |
value is empty (its length is zero).
|
inline |
Inserts characters into the string.
| index | The position at which the content will be inserted. |
| count | The number of characters to insert. |
| ch | The character to insert. |
| 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. |
count copies of character ch at the position index.
|
inline |
Inserts characters into the string.
| index | The position at which the content will be inserted. |
| s | The pointer to the character string to insert. |
| 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. |
s at the position index. The length of the string is determined by the first null character using traits_t::length(s). auto insert(size_type index, const_pointer s) -> basic_string_builder& {return insert(index, basic_string_builder(s));} / @brief Inserts characters into the string. / @param index The position at which the content will be inserted. / @param s The pointer to the character string to insert. / @param count The number of characters to insert. / @return A reference to this instance after the insert operation has completed. / @exception xtd::argument_out_of_range_exceptionindexis greater than the length of this instance.<rr>-or-<br>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 positionindex. The range can contain null characters. auto insert(size_type index, const_pointer s, size_type count) -> basic_string_builder& {return insert(index, basic_string_builder(s, count));} / @brief Inserts characters into the string. / @param index The position at which the content will be inserted. / @param str The string to insert. / @return A reference to this instance after the insert operation has completed. / @exception xtd::argument_out_of_range_exceptionindexis greater than the length of this instance.<rr>-or-<br>Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. / @remarks Inserts stringstrat the positionindex. auto insert(size_type index, const basic_string_builder & str) -> basic_string_builder& {return insert(index, str, 0, str.length());} / @brief Inserts characters into the string. / @param index The position at which the content will be inserted. / @param str The string to insert. / @param s_index The position of the first character in str to insert. / @param count The number of characters to insert. / @return A reference to this instance after the insert operation has completed. / @exception xtd::argument_out_of_range_exceptionindexis greater than the length of this instance.<rr>-or-<br>Enlarging the value of this instance would exceed xtd::text::basic_string_builder::max_capacity. / @remarks Inserts a string, obtained bystr.substr(s_index, count)at the positionindex.
|
inlinenoexcept |
Inserts characters into the string.
| index | The position at which the content will be inserted. |
| str | The string to insert. |
| s_index | The position of the first character in str to insert. |
| 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. |
str.substr(s_index, str.length()) at the position `index. auto insert(size_type index, const basic_string_builder & str, size_type s_index) -> basic_string_builder& {return insert(index, str.chars_, s_index, str.length() - s_index);}/ Removes the specified range of characters from this instance. /
| start_index | The zero-based position in this instance where removal begins. / |
| length | The number of characters to remove. / |
| xtd::argument_out_of_range_exception | If `start_index` + `length` is greater than the length of this instance. / |
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. / / Replaces all occurrences of a specified character in this instance with another specified character. /
| old_char | The character to replace. / |
| new_char | The character that replaces old_char. / |
old_char replaced by new_char. / old_char in the current instance. The size of the current xtd::text::basic_string_builder instance is unchanged after the replacement. auto replace(value_type old_char, value_type new_char) noexcept -> basic_string_builder& {return replace(old_char, new_char, 0, length());} / Replaces, within a substring of this instance, all occurrences of a specified character with another specified character. /| old_char | The character to replace. / |
| new_char | The character that replaces old_char. / |
| start_index | The position in this instance where the substring begins. / |
| count | The length of the substring. / |
old_char replaced by new_char in the range from start_ index to start_index + count - 1. / old_char in the current instance. The size of the current xtd::text::basic_string_builder object is unchanged after the replacement. auto replace(value_type old_char, value_type new_char, size_type start_index, size_type count) -> basic_string_builder& {return replace(xtd::basic_string<char_t>(old_char, 1), xtd::basic_string<char_t>(new_char, 1), start_index, count);} / Replaces all occurrences of a specified string in this instance with another specified string. /| old_value | The string to replace. / |
| new_value | The 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. |
|
inline |
Replaces, within a substring of this instance, all occurrences of a specified string with another specified string.
| old_value | The string to replace. |
| new_value | The 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. auto replace(const xtd::basic_string<char_t>& old_value, const xtd::basic_string<char_t>& new_value, size_type start_index, size_type count) -> basic_string_builder& { if (start_index > length() || start_index + count > length()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range); auto old_size = old_value.length(); auto new_size = new_value.length(); auto index = xtd::size {0}; while (true) { index = chars_.find(old_value, index); if (index == npos || index >= start_index + count) break; if (index >= start_index) { if (old_size == new_size) replace(index, old_size, new_value); else { chars_.erase(index, old_value.length()); insert(index, new_value); } } index += new_value.length(); } return self_; } |
/ Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters. /
| pos | The start of the substring that is going to be replaced. / |
| count | The length of the substring that is going to be replaced. / |
| str | The string to use for replacement. / |
str. auto replace(size_type pos, size_type count, const basic_string_builder & str) -> basic_string_builder& { if (pos > size() || pos + count > size()) xtd::helpers::throw_helper::throws(xtd::helpers::exception_case::argument_out_of_range); chars_.replace(pos, count, str); return self_; } / Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters. /| first | The first itrator of range of characters that is going to be replaced. / |
| last | The last itrator of range of characters that is going to be replaced. / |
| str | The string to use for replacement. / |
str. / begin(), first) or [first, last`) is not a valid range, the behavior is undefined.
|
inline |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
| pos | The start of the substring that is going to be replaced. |
| count | The length of the substring that is going to be replaced. |
| str | The string to use for replacement. |
| pos2 | The start of the substring to replace with. |
pos2, std::min(pos2 + count2, str.length())) of str.
|
inline |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
| pos | The start of the substring that is going to be replaced. |
| count | The length of the substring that is going to be replaced. |
| str | The string to use for replacement. |
| pos2 | The start of the substring to replace with. |
| count2 | The number of characters to replace with. |
pos2, std::min(pos2 + count2, str.length())) of str.
|
inline |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
| pos | The start of the substring that is going to be replaced. |
| count | The length of the substring that is going to be replaced. |
| cstr | The pointer to the character string to use for replacement. |
cstr, cstr + count2). cstr, cstr + count2) is not a valid range, the behavior is undefined.
|
inline |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
| first | The first itrator of range of characters that is going to be replaced. |
| last | The last itrator of range of characters that is going to be replaced. |
| cstr | The pointer to the character string to use for replacement. |
| count2 | The number of characters to replace with. |
cstr, cstr + count2). cstr, cstr + count2) is not a valid range, the behavior is undefined. begin(), first) or [first, last) is not a valid range, the behavior is undefined. auto replace(const_iterator first, const_iterator last, const_pointer cstr, size_type count2) -> basic_string_builder& { chars_.replace(first, last, cstr, count2); return self_; } / @brief Replaces the characters in the range [begin() + pos,begin() + std::min(pos + count, size())) or [first,last) with given characters. / @param pos The start of the substring that is going to be replaced. / @param count The length of the substring that is going to be replaced. / @param cstr The pointer to the character string to use for replacement. / @return 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)). auto replace(size_type pos, size_type count, const_pointer cstr) -> basic_string_builder& { chars_.replace(pos, count, cstr); return self_; } / @brief Replaces the characters in the range [begin() + pos,begin() + std::min(pos + count, size())) or [first,last) with given characters. / @param first The first itrator of range of characters that is going to be replaced. / @param last The last itrator of range of characters that is going to be replaced. / @return 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)). / @remarks If [begin(),first) or [first, last) is not a valid range, the behavior is undefined.
|
inline |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
| pos | The start of the substring that is going to be replaced. |
| count | The length of the substring that is going to be replaced. |
| count2 | The number of characters to replace with. |
count2 copies of ch.
|
inline |
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count, size())) or [first, last) with given characters.
| first | The first itrator of range of characters that is going to be replaced. |
| last | The last itrator of range of characters that is going to be replaced. |
| count2 | The number of characters to replace with. |
count2 copies of ch. begin(), first) or [first, last) is not a valid range, the behavior is undefined. auto replace(const_iterator first, const_iterator last, size_type count2, value_type ch) -> basic_string_builder& { chars_.replace(first, last, count2, ch); return self_; } / @brief Replaces the characters in the range [begin() + pos,begin() + std::min(pos + count, size())) or [first,last) with given characters. / @param first The first itrator of range of characters that is going to be replaced. / @param last The last itrator of range of characters that is going to be replaced. / @param first2 The first itrator of range of characters to use for replacement. / @param last2 The last itrator of range of characters to use for replacement. / @return This current instance of xtd::text::basic_string_builder. / @remarks Those characters are replaced with the characters in the range [first2,last2) as if byreplace(first, last, basic_string(first2, last2, get_allocator())). / @remarks If [begin(),first) or [first, last) is not a valid range, the behavior is undefined.
|
inlinestaticconstexpr |
Represents a value that is not a valid position in a collection.
|
inlinestaticconstexpr |
Represents the index of the first valid element in a collection.
0.
|
inlinestaticconstexpr |
Represents the index of the last valid element in a collection.
items.count() - 1. items[xtd::epos] directly accesses the last element without manually subtracting one from the collection count. ~1_z. With bitwise operator the code is more concise.