5#include "../basic_string.h"
6#include "../argument_exception.h"
7#include "../argument_out_of_range_exception.h"
8#include "../environment.h"
9#include "../index_out_of_range_exception.h"
10#include "../null_pointer_exception.h"
34 template<
typename char_t,
typename traits_t = std::
char_traits<
char_t>,
typename allocator_t = xtd::collections::
generic::helpers::allocator<
char_t>>
42 using base_type = std::basic_string<char_t, traits_t, allocator_t>;
58 using pointer =
typename base_type::pointer;
183 chars_ =
base_type(str.chars_, index, allocator);
193 chars_ =
base_type(str.chars_, index, count);
203 chars_ =
base_type(str.chars_, index, count, allocator);
274 template<
typename input_iterator_t>
280 template<
typename input_iterator_t>
367 bool empty() const noexcept {
return chars_.empty();}
764 template<
typename object_t>
812 chars_.append(str.chars_, pos, count);
843 template<
class input_iterator_t>
877 template<
typename ...args_t>
888 template<
typename collection_t >
898 template<
typename collection_t >
902 template<
typename value_t>
904 template<
typename value_t>
1104 return chars_.copy(dest, count);
1114 return chars_.copy(dest, count, pos);
1128 copy(destination.
data() + destination_index, destination_count, source_index);
1164 chars_.erase(index);
1174 chars_.erase(index, count);
1600 template<
typename object_t>
1612 chars_.insert(index, count, ch);
1649 chars_.insert(index, str.chars_, s_index, count);
1677 return chars_.insert(pos, count, ch);
1687 template<
typename input_iterator_t>
1691 return chars_.insert(pos, first, last);
1701 return chars_.insert(pos, ilist);
1752 auto old_size = old_value.
size();
1753 auto new_size = new_value.
size();
1756 index =
find(old_value, index);
1757 if (index ==
npos || index >= start_index + count)
break;
1758 if (index >= start_index) {
1759 if (old_size == new_size)
replace(index, old_size, new_value);
1762 insert(index, new_value);
1765 index += new_value.
size();
1778 chars_.replace(pos, count, str);
1789 chars_.replace(first, last, str);
1802 chars_.replace(pos, count, str, pos2);
1816 chars_.replace(pos, count, str, pos2, count2);
1828 chars_.replace(pos, count, cstr, count2);
1841 chars_.replace(first, last, cstr, count2);
1851 chars_.replace(pos, count, cstr);
1861 chars_.replace(first, last, cstr);
1872 chars_.replace(pos, count, count2, ch);
1883 chars_.replace(first, last, count2, ch);
1894 template<
typename input_iterator_t>
1896 chars_.replace(first, last, first2, last2);
1907 chars_.replace(first, last, ilist);
1919 chars_.reserve(new_cap);
1994 return chars_.substr(pos);
2004 return chars_.substr(pos, count);
2033 return chars_[index];
2041 return chars_[index];
2055 chars_ = str.chars_;
2063 chars_ = std::move(str.chars_);
2079 chars_ = std::move(str);
2095 chars_ = std::move(str);
2129 chars_ += str.chars_;
2137 chars_ += std::move(str.chars_);
2174 auto result = std::move(lhs);
2175 result += std::move(rhs);
2184 auto result = std::move(lhs);
2195 result += std::move(rhs);
2214 auto result = std::move(lhs);
2224 return lhs + rhs.chars_;
2232 return lhs + std::move(rhs).chars_;
2250 auto result = std::move(lhs);
2271 result += std::move(rhs);
2302 auto s = std::basic_string<char> {};
2316 auto s = std::basic_string<xtd::wchar> {};
2325 size_type max_capacity_ = chars_.max_size();
The exception that is thrown when one of the arguments provided to a method is out of range.
Definition argument_out_of_range_exception.h:23
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.h:58
virtual pointer data() noexcept
Returns pointer to the underlying array serving as element storage.
Definition basic_array.h:131
virtual size_type size() const noexcept
Returns the number of elements in the container, i.e. std::distance(xtd::array::begin(),...
Definition basic_array.h:211
Represents text as a sequence of character units.
Definition basic_string.h:79
const base_type & chars() const noexcept
Returns a reference to the underlying base type.
Definition basic_string.h:883
size_type size() const noexcept
Returns the number of char_t elements in the string, i.e. std::distance(begin(), end()).
Definition basic_string.h:934
size_type length() const noexcept
Gets the number of characters in the current xtd::basic_string object.
Definition basic_string.h:918
static xtd::string new_line() noexcept
Gets the newline string defined for this environment.
static xtd::size combine(args_t... values) noexcept
Combines values into a hash code.
Definition hash_code.h:65
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:22
The exception that is thrown when an attempt is made to access an element of an array with an index t...
Definition index_out_of_range_exception.h:19
The exception that is thrown when there is an attempt to dereference a null object pointer.
Definition null_pointer_exception.h:19
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
Represents a mutable string of characters. This class cannot be inherited.
Definition basic_string_builder.h:35
size_type rfind(const_pointer s) const
Finds the last substring that is equal to the given character sequence. The search begins at xtd::tex...
Definition basic_string_builder.h:1957
typename base_type::size_type size_type
Represents the basic string size type.
Definition basic_string_builder.h:50
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....
Definition basic_string_builder.h:1244
basic_string_builder & append(object_t value)
Appends the string representation of a specified object to this instance.
Definition basic_string_builder.h:765
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....
Definition basic_string_builder.h:1276
base_type & chars() noexcept
Returns a reference to the underlying base type.
Definition basic_string_builder.h:342
void push_back(value_type ch)
Appends the given character ch to the end of the string.
Definition basic_string_builder.h:1710
static constexpr size_type npos
This is a special value equal to the maximum value representable by the type xtd::size.
Definition basic_string_builder.h:77
basic_string_builder & operator+=(const basic_string_builder &str)
Addition assignment operator. Appends additional characters to the string.
Definition basic_string_builder.h:2128
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 ...
Definition basic_string_builder.h:154
typename base_type::difference_type difference_type
Represents the basic string difference type.
Definition basic_string_builder.h:52
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....
Definition basic_string_builder.h:1402
iterator erase(const_iterator position)
Removes specified characters from the string.
Definition basic_string_builder.h:1182
bool equals(const basic_string_builder &value) const noexcept override
Determines whether this instance and another specified xtd::text::basic_string_builder object have th...
Definition basic_string_builder.h:1139
basic_string_builder & insert(size_type index, const_pointer s, size_type count)
Inserts characters into the string.
Definition basic_string_builder.h:1629
basic_string_builder & replace(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,...
Definition basic_string_builder.h:1799
size_type find_first_of(const_pointer s) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string_builder.h:1258
basic_string_builder & replace(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,...
Definition basic_string_builder.h:1895
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....
Definition basic_string_builder.h:1238
basic_string_builder & insert(size_type index, xtd::uint16 value)
Inserts the string representation of a specified 16-bit unsigned integer into this instance at the sp...
Definition basic_string_builder.h:1542
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...
Definition basic_string_builder.h:275
basic_string_builder & append(const basic_string_builder &str, size_type pos)
Appends additional characters to the string.
Definition basic_string_builder.h:796
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....
Definition basic_string_builder.h:1326
void resize(size_type count)
Resizes the string to contain count characters.
Definition basic_string_builder.h:1926
basic_string_builder substr() const
Returns a substring [pos, pos + count). If the requested substring extends past the end of the string...
Definition basic_string_builder.h:1986
size_type find_first_of(value_type ch) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string_builder.h:1270
basic_string_builder & insert(size_type index, double value)
Inserts the string representation of a specified double into this instance at the specified character...
Definition basic_string_builder.h:1482
int32 compare(const_pointer s) const
Compares two character sequences.
Definition basic_string_builder.h:1050
basic_string_builder & capacity(size_type value)
Sets the number of characters that the string has currently allocated space for.
Definition basic_string_builder.h:327
basic_string_builder & insert(size_type index, const basic_string_builder &str)
Inserts characters into the string.
Definition basic_string_builder.h:1636
size_type find(value_type ch) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string_builder.h:1226
friend std::basic_istream< char > & operator>>(std::basic_istream< char > &stream, basic_string_builder &str)
Input stream operator. Behaves as a FormattedInputFunction. After constructing and checking the sentr...
Definition basic_string_builder.h:2301
basic_string_builder & operator=(const basic_string_builder &str) noexcept
Copy assignment operator. Replaces the contents with a copy of the contents of str.
Definition basic_string_builder.h:2054
basic_string_builder & replace(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,...
Definition basic_string_builder.h:1826
basic_string_builder & append(const_pointer s, size_type count)
Appends additional characters to the string.
Definition basic_string_builder.h:825
size_type capacity() const noexcept
Returns the number of characters that the string has currently allocated space for.
Definition basic_string_builder.h:324
basic_string_builder & append(const basic_string_builder &str, size_type pos, size_type count)
Appends additional characters to the string.
Definition basic_string_builder.h:809
basic_string_builder & replace(value_type old_char, value_type new_char) noexcept
Replaces all occurrences of a specified character in this instance with another specified character.
Definition basic_string_builder.h:1726
basic_string_builder & append(xtd::int16 value)
Appends the string representation of a specified 16-bit signed integer value to this instance.
Definition basic_string_builder.h:589
typename base_type::traits_type traits_type
Represents the basic string traits type.
Definition basic_string_builder.h:44
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....
Definition basic_string_builder.h:1320
virtual const base_type & get_base_type() const noexcept
Returns the underlying base type.
Definition basic_string_builder.h:1416
basic_string_builder & length(size_type value) noexcept
Sets or sets the length of the current xtd::text::basic_string_builder object.
Definition basic_string_builder.h:402
basic_string_builder & replace(size_type pos, size_type count, const basic_string_builder &str)
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count,...
Definition basic_string_builder.h:1776
size_type rfind(value_type ch) const
Finds the last substring that is equal to the given character sequence. The search begins at xtd::tex...
Definition basic_string_builder.h:1969
basic_string_builder & append(double value)
Appends the string representation of a specified double value to this instance.
Definition basic_string_builder.h:551
iterator end()
Returns an iterator to the character following the last character of the string. This character acts ...
Definition basic_string_builder.h:374
basic_string_builder(xtd::size capacity)
Initializes a new instance of the xtd::text::basic_string_builder class using the specified capacity.
Definition basic_string_builder.h:101
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....
Definition basic_string_builder.h:1314
basic_string_builder & replace(const_iterator first, const_iterator last, const_pointer cstr)
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count,...
Definition basic_string_builder.h:1860
basic_string_builder & append_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 curr...
Definition basic_string_builder.h:922
basic_string_builder & insert(size_type index, const basic_string_builder &str, size_type s_index)
Inserts characters into the string.
Definition basic_string_builder.h:1659
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....
Definition basic_string_builder.h:1390
basic_string_builder & replace(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,...
Definition basic_string_builder.h:1813
size_type find(const_pointer s, size_type pos) const
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_string_builder.h:1221
basic_string_builder & append(xtd::int32 value)
Appends the string representation of a specified 32-bit signed integer value to this instance.
Definition basic_string_builder.h:608
size_type find_last_of(value_type ch) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string_builder.h:1358
basic_string_builder & insert(size_type index, xtd::decimal value)
Inserts the string representation of a specified 8decimal into this instance at the specified charact...
Definition basic_string_builder.h:1472
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 ...
Definition basic_string_builder.h:116
const_reference operator[](xtd::size index) const
Returns a reference to the character at specified location index.
Definition basic_string_builder.h:2031
basic_string_builder & append(xtd::sbyte value)
Appends the string representation of a specified 8-bit signed integer value to this instance.
Definition basic_string_builder.h:647
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 alloc...
Definition basic_string_builder.h:269
void shrink_to_fit()
Requests the removal of unused capacity.
Definition basic_string_builder.h:1980
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...
Definition basic_string_builder.h:2002
iterator erase(const_iterator first, const_iterator last)
Removes specified characters from the string.
Definition basic_string_builder.h:1189
size_type find_last_of(const_pointer s) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string_builder.h:1346
const_reference at(size_type pos) const
Returns a reference to the character at specified location pos.
Definition basic_string_builder.h:927
basic_string_builder & insert(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 inst...
Definition basic_string_builder.h:1583
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.
Definition basic_string_builder.h:125
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,...
Definition basic_string_builder.h:201
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....
Definition basic_string_builder.h:1408
basic_string_builder & insert(size_type index, size_type count, value_type ch)
Inserts characters into the string.
Definition basic_string_builder.h:1609
basic_string_builder & append(const xtd::basic_string< char_t > &value, size_type start_index, size_type count)
Appends a copy of a specified substring to this instance.
Definition basic_string_builder.h:474
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 ...
Definition basic_string_builder.h:1943
basic_string_builder & append(value_type value, size_type repeat_count)
Appends a specified number of copies of the string representation of a Unicode character to this inst...
Definition basic_string_builder.h:747
basic_string_builder & append(value_type value)
Appends the string representation of a specified xtd::text::basic_string_builder::value_type value to...
Definition basic_string_builder.h:727
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.
Definition basic_string_builder.h:265
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....
Definition basic_string_builder.h:1265
iterator insert(const_iterator pos, std::initializer_list< value_type > ilist)
Inserts characters into the string.
Definition basic_string_builder.h:1699
basic_string_builder & append(const basic_string_builder &str)
Appends additional characters to the string.
Definition basic_string_builder.h:784
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....
Definition basic_string_builder.h:1302
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....
Definition basic_string_builder.h:1309
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....
Definition basic_string_builder.h:1370
basic_string_builder & erase()
Removes specified characters from the string.
Definition basic_string_builder.h:1154
typename base_type::const_pointer const_pointer
Represents the basic string const pointer type.
Definition basic_string_builder.h:60
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 characte...
Definition basic_string_builder.h:232
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....
Definition basic_string_builder.h:1252
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....
Definition basic_string_builder.h:1353
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 alloc...
Definition basic_string_builder.h:212
basic_string_builder & append(input_iterator_t first, input_iterator_t last)
Appends additional characters to the string.
Definition basic_string_builder.h:844
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,...
Definition basic_string_builder.h:258
xtd::size get_hash_code() const noexcept override
Returns the hash code for this basic_string_builder.
Definition basic_string_builder.h:1420
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....
Definition basic_string_builder.h:1288
basic_string_builder & append(xtd::decimal value)
Appends the string representation of a specified decimal value to this instance.
Definition basic_string_builder.h:532
basic_string_builder & insert(size_type index, const basic_string_builder &str, size_type s_index, size_type count)
Inserts characters into the string.
Definition basic_string_builder.h:1645
basic_string_builder & replace(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 ...
Definition basic_string_builder.h:1734
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 substr...
Definition basic_string_builder.h:1112
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....
Definition basic_string_builder.h:1332
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
reference front()
Returns reference to the first character in the string. The behavior is undefined if empty() is true.
Definition basic_string_builder.h:383
basic_string_builder & append(xtd::uint64 value)
Appends the string representation of a specified 64-bit unsigned integer value to this instance.
Definition basic_string_builder.h:704
basic_string_builder()=default
Initializes a new instance of xtd::text::basic_string_builder.
basic_string_builder & append(xtd::uint32 value)
Appends the string representation of a specified 32-bit unsigned integer value to this instance.
Definition basic_string_builder.h:685
reference at(size_type pos)
Returns a reference to the character at specified location pos.
Definition basic_string_builder.h:931
basic_string_builder & insert(size_type index, xtd::boolean value)
Inserts the string representation of a boolean value into this instance at the specified character po...
Definition basic_string_builder.h:1452
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
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 a...
Definition basic_string_builder.h:181
iterator insert(const_iterator pos, size_type count, value_type ch)
Inserts characters into the string.
Definition basic_string_builder.h:1674
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....
Definition basic_string_builder.h:1282
typename base_type::const_reference const_reference
Represents the basic string const referecne type.
Definition basic_string_builder.h:56
basic_string_builder & insert(size_type index, value_type value)
Inserts the string representation of a specified Unicode character into this instance at the specifie...
Definition basic_string_builder.h:1572
basic_string_builder & replace(const_iterator first, const_iterator last, const basic_string_builder &str)
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count,...
Definition basic_string_builder.h:1788
iterator insert(const_iterator pos, input_iterator_t first, input_iterator_t last)
Inserts characters into the string.
Definition basic_string_builder.h:1688
basic_string_builder & append(std::initializer_list< value_type > ilist)
Appends additional characters to the string.
Definition basic_string_builder.h:856
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....
Definition basic_string_builder.h:1376
int32 compare(size_type pos1, size_type count1, const_pointer s) const
Compares two character sequences.
Definition basic_string_builder.h:1072
basic_string_builder & append(const_pointer s)
Appends additional characters to the string.
Definition basic_string_builder.h:834
basic_string_builder & append(xtd::byte value)
Appends the string representation of a specified 8-bit unsigned value to this instance.
Definition basic_string_builder.h:513
basic_string_builder & append_join(value_type separator, const collection_t &values)
Concatenates and appends the members of a collection, using the specified xtd::basic_string_builder::...
Definition basic_string_builder.h:899
basic_string_builder & insert(size_type index, xtd::uint64 value)
Inserts the string representation of a specified 64-bit unsigned integer into this instance at the sp...
Definition basic_string_builder.h:1562
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
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,...
Definition basic_string_builder.h:1208
xtd::string to_string() const noexcept override
Converts the value of this instance to a xtd::text::basic_string_builder <char>.
Definition basic_string_builder.h:2015
friend std::basic_ostream< char > & operator<<(std::basic_ostream< char > &stream, const basic_string_builder &str)
Output stream operator. Behaves as a FormattedOutputFunction. After constructing and checking the sen...
Definition basic_string_builder.h:2284
basic_string_builder & clear()
Removes all characters from the current xtd::text::basic_string_builder instance.
Definition basic_string_builder.h:937
basic_string_builder & replace(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.
Definition basic_string_builder.h:1741
basic_string_builder & replace(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,...
Definition basic_string_builder.h:1906
basic_string_builder & append(xtd::int64 value)
Appends the string representation of a specified 64-bit signed integer value to this instance.
Definition basic_string_builder.h:627
const_pointer c_str() const noexcept
Returns a pointer to a null-terminated character array with data equivalent to those stored in the st...
Definition basic_string_builder.h:320
const_reference back() const
Returns reference to the last character in the string.
Definition basic_string_builder.h:299
basic_string_builder & insert(size_type index, object_t value)
Inserts the string representation of a specified object into this instance at the specified character...
Definition basic_string_builder.h:1601
basic_string_builder & insert(size_type index, xtd::int32 value)
Inserts the string representation of a specified 32-bit signed integer into this instance at the spec...
Definition basic_string_builder.h:1512
int32 compare(size_type pos1, size_type count1, const basic_string_builder &str, size_type pos2) const
Compares two character sequences.
Definition basic_string_builder.h:1006
typename base_type::reference reference
Represents the basic string referecne type.
Definition basic_string_builder.h:54
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 an...
Definition basic_string_builder.h:137
basic_string_builder & replace(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,...
Definition basic_string_builder.h:1870
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 ...
Definition basic_string_builder.h:1951
int32 compare(size_type pos1, size_type count1, const_pointer s, size_type count2) const
Compares two character sequences.
Definition basic_string_builder.h:1095
size_type max_size() const noexcept
Returns the maximum number of elements the string is able to hold due to system or library implementa...
Definition basic_string_builder.h:413
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....
Definition basic_string_builder.h:1397
basic_string_builder(basic_string_builder &&str) noexcept
Initializes a new instance of xtd::text::basic_string_builder with specified string to move.
Definition basic_string_builder.h:208
void swap(basic_string_builder &other) noexcept
Exchanges the contents of the string with those of other. All iterators and references may be invalid...
Definition basic_string_builder.h:2009
size_type find(const_pointer s) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string_builder.h:1214
const_iterator cbegin() const
Returns an iterator to the first character of the string.
Definition basic_string_builder.h:334
basic_string_builder(xtd::size count, value_type character)
Definition basic_string_builder.h:217
typename base_type::pointer pointer
Represents the basic string pointer type.
Definition basic_string_builder.h:58
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...
Definition basic_string_builder.h:1992
basic_string_builder & erase(size_type index)
Removes specified characters from the string.
Definition basic_string_builder.h:1162
basic_string_builder & replace(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,...
Definition basic_string_builder.h:1840
basic_string_builder & append_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 memb...
Definition basic_string_builder.h:889
basic_string_builder & remove(size_type start_index, size_type length)
Removes the specified range of characters from this instance.
Definition basic_string_builder.h:1719
typename base_type::iterator iterator
Represents the basic string iterator type.
Definition basic_string_builder.h:63
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 t...
Definition basic_string_builder.h:1916
iterator insert(const_iterator pos, value_type ch)
Inserts characters into the string.
Definition basic_string_builder.h:1666
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 ...
Definition basic_string_builder.h:1964
const_iterator begin() const
Returns an iterator to the first character of the string.
Definition basic_string_builder.h:307
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 destinati...
Definition basic_string_builder.h:1125
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 c...
Definition basic_string_builder.h:191
basic_string_builder(const_pointer str, xtd::size count)
Initializes a new instance of xtd::text::basic_string_builder with specified substring and count char...
Definition basic_string_builder.h:250
void resize(size_type count, value_type ch)
Resizes the string to contain count characters.
Definition basic_string_builder.h:1932
basic_string_builder(const basic_string_builder &str) noexcept
Initializes a new instance of xtd::text::basic_string_builder with specified string to copy.
Definition basic_string_builder.h:162
void pop_back()
Removes the last character from the string.
Definition basic_string_builder.h:1706
allocator_type get_allocator() const
Returns the allocator associated with the string.
Definition basic_string_builder.h:1412
basic_string_builder & insert(size_type index, xtd::byte value)
Inserts the string representation of a specified 8-bit unsigned integer into this instance at the spe...
Definition basic_string_builder.h:1462
basic_string_builder(const_pointer str)
Initializes a new instance of xtd::text::basic_string_builder with specified string to copy.
Definition basic_string_builder.h:236
basic_string_builder(const allocator_type &allocator) noexcept
Initializes a new instance of xtd::text::basic_string_builder with specified allocator.
Definition basic_string_builder.h:158
basic_string_builder & erase(size_type index, size_type count)
Removes specified characters from the string.
Definition basic_string_builder.h:1172
basic_string_builder & replace(size_type pos, size_type count, const_pointer cstr)
Replaces the characters in the range [begin() + pos, begin() + std::min(pos + count,...
Definition basic_string_builder.h:1850
size_type ensure_capacity(size_type capacity)
Ensures that the capacity of this instance of xtd::text::basic_string_builder is at least the specifi...
Definition basic_string_builder.h:1146
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...
Definition basic_string_builder.h:281
basic_string_builder & insert(size_type index, xtd::sbyte value)
Inserts the string representation of a specified 8-bit signed integer into this instance at the speci...
Definition basic_string_builder.h:1532
basic_string_builder(std::initializer_list< value_type > il)
Initializes a new instance of xtd::text::basic_string_builder with specified initializer list.
Definition basic_string_builder.h:285
const base_type & chars() const noexcept
Returns a reference to the underlying base type.
Definition basic_string_builder.h:338
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.
Definition basic_string_builder.h:172
const_reference front() const
Returns reference to the first character in the string. The behavior is undefined if empty() is true.
Definition basic_string_builder.h:379
int32 compare(size_type pos1, size_type count1, const basic_string_builder &str) const
Compares two character sequences.
Definition basic_string_builder.h:982
bool empty() const noexcept
Checks if the string has no characters, i.e. whether begin() == end().
Definition basic_string_builder.h:367
basic_string_builder & insert(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 positi...
Definition basic_string_builder.h:1442
std::basic_string< char_t, traits_t, allocator_t > base_type
Represents the basic string base type.
Definition basic_string_builder.h:42
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,...
Definition basic_string_builder.h:1200
iterator begin()
Returns an iterator to the first character of the string.
Definition basic_string_builder.h:310
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....
Definition basic_string_builder.h:1296
size_type find(value_type ch, size_type pos) const
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_string_builder.h:1232
size_type size() const noexcept
Returns the number of char_t elements in the string, i.e. std::distance(begin(), end()).
Definition basic_string_builder.h:417
const_pointer data() const noexcept
Returns a pointer to the underlying array serving as character storage. The pointer is such that the ...
Definition basic_string_builder.h:355
pointer data() noexcept
Returns a pointer to the underlying array serving as character storage. The pointer is such that the ...
Definition basic_string_builder.h:363
basic_string_builder & replace(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 spe...
Definition basic_string_builder.h:1750
friend basic_string_builder operator+(const basic_string_builder &lhs, const basic_string_builder &rhs)
Addition operator. Returns a string containing characters from lhs followed by the characters from rh...
Definition basic_string_builder.h:2163
basic_string_builder & insert(size_type index, const xtd::basic_string< char_t > &value)
Inserts a string into this instance at the specified character position.
Definition basic_string_builder.h:1431
basic_string_builder & append_line()
Appends the default line terminator to the end of the current xtd::text::basic_string_builder object.
Definition basic_string_builder.h:914
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 all...
Definition basic_string_builder.h:290
int32 compare(const basic_string_builder &str) const
Compares two character sequences.
Definition basic_string_builder.h:960
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 ...
Definition basic_string_builder.h:1975
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....
Definition basic_string_builder.h:1384
size_type find(const basic_string_builder &str) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string_builder.h:1194
typename base_type::const_reverse_iterator const_reverse_iterator
Represents the basic string const reverse iterator type.
Definition basic_string_builder.h:70
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 substr...
Definition basic_string_builder.h:1102
basic_string_builder & insert(size_type index, const_pointer s)
Inserts characters into the string.
Definition basic_string_builder.h:1621
typename base_type::const_iterator const_iterator
Represents the basic string const iterator type.
Definition basic_string_builder.h:66
basic_string_builder & append(xtd::single value)
Appends the string representation of a specified single value to this instance.
Definition basic_string_builder.h:570
basic_string_builder & insert(size_type index, xtd::uint32 value)
Inserts the string representation of a specified 32-bit unsigned integer into this instance at the sp...
Definition basic_string_builder.h:1552
basic_string_builder & replace(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,...
Definition basic_string_builder.h:1882
basic_string_builder & append(xtd::uint16 value)
Appends the string representation of a specified 16-bit unsigned integer value to this instance.
Definition basic_string_builder.h:666
basic_string_builder & insert(size_type index, xtd::int64 value)
Inserts the string representation of a specified 64-bit signed integer into this instance at the spec...
Definition basic_string_builder.h:1522
reference back()
Returns reference to the last character in the string.
Definition basic_string_builder.h:303
typename base_type::allocator_type allocator_type
Represents the basic string allocator type.
Definition basic_string_builder.h:48
basic_string_builder & insert(size_type index, xtd::int16 value)
Inserts the string representation of a specified 16-bit signed integer into this instance at the spec...
Definition basic_string_builder.h:1502
const_iterator cend() const
Returns an iterator to the character following the last character of the string. This character acts ...
Definition basic_string_builder.h:346
typename base_type::reverse_iterator reverse_iterator
Represents the basic string reverse iterator type.
Definition basic_string_builder.h:68
const_iterator end() const
Returns an iterator to the character following the last character of the string. This character acts ...
Definition basic_string_builder.h:371
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,...
Definition basic_string_builder.h:243
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 alloc...
Definition basic_string_builder.h:166
basic_string_builder & insert(size_type index, xtd::single value)
Inserts the string representation of a specified single into this instance at the specified character...
Definition basic_string_builder.h:1492
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....
Definition basic_string_builder.h:1340
basic_string_builder(value_type character, xtd::size count)
Initializes a new instance of xtd::text::basic_string_builder with specified count copies of characte...
Definition basic_string_builder.h:227
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....
Definition basic_string_builder.h:1364
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...
Definition basic_string_builder.h:1134
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 characte...
Definition basic_string_builder.h:222
int32 compare(size_type pos1, size_type count1, const basic_string_builder &str, size_type pos2, size_type count2) const
Compares two character sequences.
Definition basic_string_builder.h:1031
typename base_type::value_type value_type
Represents the basic string value type.
Definition basic_string_builder.h:46
basic_string_builder & append(xtd::boolean value)
Appends the string representation of a specified boolean value to this instance.
Definition basic_string_builder.h:493
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::tex...
Definition basic_string_builder.h:1937
basic_string_builder & append_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 form...
Definition basic_string_builder.h:878
basic_string_builder & append(size_type count, value_type ch)
Appends additional characters to the string.
Definition basic_string_builder.h:775
int16_t int16
Represents a 16-bit signed integer.
Definition int16.h:23
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
long double decimal
Represents a decimal-precision floating-point number.
Definition decimal.h:23
int64_t int64
Represents a 64-bit signed integer.
Definition int64.h:23
null_ptr null
Represents a null pointer value.
__ulong__ ulong
Represents a 32-bit or 64-bit unsigned integer.
Definition ulong.h:27
int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.h:23
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.h:23
float single
Represents a single-precision floating-point number.
Definition single.h:23
size_t size
Represents a size of any object in bytes.
Definition size.h:23
uint64_t uint64
Represents a 64-bit unsigned integer.
Definition uint64.h:23
bool boolean
Represents a boolean.
Definition boolean.h:23
uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.h:23
uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.h:23
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition slong.h:27
@ other
The operating system is other.
@ separator
The Separator key.
@ insert
The INS (INSERT) key.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10