6#define __XTD_CORE_INTERNAL__
11#undef __XTD_CORE_INTERNAL__
12#define __XTD_STD_INTERNAL__
14#undef __XTD_STD_INTERNAL__
30#if defined(__xtd__cpp_lib_format)
39template<
class ...args_t>
41template<
class target_t,
class source_t>
42std::basic_string<target_t> __xtd_convert_to_string(std::basic_string<source_t>&& str)
noexcept;
43template<
class target_t,
class source_t>
44std::basic_string<target_t> __xtd_convert_to_string(
const std::basic_string<source_t>& str)
noexcept;
45std::basic_string<char> __xtd_demangle(
const std::basic_string<char>& value)
noexcept;
46std::basic_string<char> __xtd_get_class_name(
const std::type_info& value)
noexcept;
47std::basic_string<char> __xtd_get_full_class_name(
const std::type_info& value)
noexcept;
70 template<
class char_t,
class traits_t,
class allocator_t>
78 using base_type = std::basic_string<char_t, traits_t, allocator_t>;
94 using pointer =
typename base_type::pointer;
134 if constexpr (std::is_same_v<char, char_t>) chars_ = str.chars_;
135 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
141 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = str.chars_;
142 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
147 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = str.chars_;
148 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
150#if defined(__xtd__cpp_lib_char8_t)
154 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = str.chars_;
155 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
161 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = str.chars_;
162 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
169 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str.chars_, allocator);
170 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str.chars_), allocator);
176 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str.chars_, allocator);
177 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str.chars_), allocator);
183 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str.chars_, allocator);
184 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str.chars_), allocator);
186#if defined(__xtd__cpp_lib_char8_t)
191 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str.chars_, allocator);
192 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str.chars_), allocator);
199 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str.chars_, allocator);
200 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str.chars_), allocator);
209 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str.chars_, index);
210 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index)));
218 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str.chars_, index);
219 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index)));
227 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str.chars_, index);
228 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index)));
230#if defined(__xtd__cpp_lib_char8_t)
237 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str.chars_, index);
238 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index)));
247 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str.chars_, index);
248 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index)));
258 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str.chars_, index, allocator);
259 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index)), allocator);
268 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str.chars_, index, allocator);
269 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index)), allocator);
278 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str.chars_, index, allocator);
279 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index)), allocator);
281#if defined(__xtd__cpp_lib_char8_t)
289 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str.chars_, index, allocator);
290 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index)), allocator);
300 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str.chars_, index, allocator);
301 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index)), allocator);
311 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str.chars_, index,
count);
312 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index,
count)));
321 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str.chars_, index,
count);
322 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index,
count)));
331 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str.chars_, index,
count);
332 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index,
count)));
334#if defined(__xtd__cpp_lib_char8_t)
342 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str.chars_, index,
count);
343 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index,
count)));
353 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str.chars_, index,
count);
354 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index,
count)));
365 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str.chars_, index,
count, allocator);
366 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index,
count)), allocator);
376 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str.chars_, index,
count, allocator);
377 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index,
count)), allocator);
387 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str.chars_, index,
count, allocator);
388 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index,
count)), allocator);
390#if defined(__xtd__cpp_lib_char8_t)
399 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str.chars_, index,
count, allocator);
400 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index,
count)), allocator);
411 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str.chars_, index,
count, allocator);
412 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index,
count)), allocator);
452#if defined(__xtd__cpp_lib_char8_t)
501#if defined(__xtd__cpp_lib_char8_t)
526 if constexpr (std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str);
527 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str));
533 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str);
534 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str));
540 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str);
541 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str));
543#if defined(__xtd__cpp_lib_char8_t)
548 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str);
549 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str));
556 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str);
557 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
565 if constexpr (std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str, allocator);
566 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str), allocator);
573 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str, allocator);
574 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str), allocator);
581 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str, allocator);
582 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str), allocator);
584#if defined(__xtd__cpp_lib_char8_t)
590 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str, allocator);
591 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str), allocator);
599 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str);
600 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
607 if constexpr (std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str,
count);
608 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str,
count));
614 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str,
count);
615 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str,
count));
621 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str,
count);
622 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str,
count));
624#if defined(__xtd__cpp_lib_char8_t)
629 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str,
count);
630 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str,
count));
637 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str,
count);
638 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str,
count));
647 if constexpr (std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str,
count, allocator);
648 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str,
count), allocator);
656 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str,
count, allocator);
657 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str,
count), allocator);
665 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str,
count, allocator);
666 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str,
count), allocator);
668#if defined(__xtd__cpp_lib_char8_t)
675 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str,
count, allocator);
676 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str,
count), allocator);
685 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str,
count, allocator);
686 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str,
count), allocator);
692 if constexpr (std::is_same_v<char, char_t>) chars_ = str;
693 else chars_ = __xtd_convert_to_string<value_type>(str);
698 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = str;
699 else chars_ = __xtd_convert_to_string<value_type>(str);
704 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = str;
705 else chars_ = __xtd_convert_to_string<value_type>(str);
707#if defined(__xtd__cpp_lib_char8_t)
711 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = str;
712 else chars_ = __xtd_convert_to_string<value_type>(str);
718 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = str;
719 else chars_ = __xtd_convert_to_string<value_type>(str);
726 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str, allocator);
727 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str), allocator);
733 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str, allocator);
734 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str), allocator);
740 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str, allocator);
741 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str), allocator);
743#if defined(__xtd__cpp_lib_char8_t)
748 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str, allocator);
749 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str), allocator);
756 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str, allocator);
757 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str), allocator);
763 template<
class input_iterator_t>
764 basic_string(input_iterator_t first, input_iterator_t last) : chars_(first, last) {}
769 template<
class input_iterator_t>
775 template<
class string_view_like_t>
776 explicit constexpr basic_string(
const string_view_like_t& string_view) : chars_(string_view) {}
780 template<
class string_view_like_t>
787 template<
class string_view_like_t>
794 template<
class string_view_like_t>
806#if defined(__xtd__cpp_lib_char8_t)
827#if defined(__xtd__cpp_lib_char8_t)
896 bool empty() const noexcept {
return chars_.empty();}
1139 if (ignore_case)
return to_upper().chars_ == value.to_upper().chars_;
1140 return chars_ == value.chars_;
1170 return rfind(value) + value.size() ==
size();
1407 explicit basic_string_enumerator(
const basic_string& chars) : chars_(chars) {}
1409 const value_type& current()
const override {
return chars_[index_];}
1411 bool move_next()
override {
return ++index_ < chars_.size();}
1413 void reset()
override {index_ = basic_string::npos;}
1419 return {new_ptr<basic_string_enumerator>(*
this)};
1439 auto result =
find(value, start_index);
1440 return result > start_index +
count ?
npos : result;
1459 auto result =
find(value, start_index);
1460 return result > start_index +
count ?
npos : result;
1494 auto result = *
this;
1495 result.chars_.insert(start_index, value);
1502 [[deprecated(
"Replaced by xtd::basic_string::is_empty(const xtd::basic_string&) - Will be removed in version 0.4.0.")]]
1524 return result < start_index ?
npos : result;
1545 auto result =
rfind(value, start_index +
count - 1);
1546 return result < start_index ?
npos : result;
1614 std::wstringstream ss;
1615 if constexpr (std::is_same_v<xtd::wchar, value_type>) ss << std::quoted(chars_, delimiter,
escape);
1616 else ss << std::quoted(__xtd_convert_to_string<xtd::wchar>(chars_),
static_cast<xtd::wchar>(delimiter),
static_cast<xtd::wchar>(
escape));
1630 auto result = *
this;
1631 result.chars_.erase(start_index,
count);
1646 auto result = *
this;
1647 auto old_size = old_string.
size();
1648 auto new_size = new_string.size();
1651 index = result.find(old_string, index);
1652 if (index ==
npos)
break;
1653 if (old_size == new_size) result.chars_.replace(index, old_size, new_string);
1655 result.chars_.erase(index, old_string.size());
1656 result.chars_.insert(index, new_string);
1658 index += new_string.size();
1812 return find(value) == 0;
1831 return find(value) == 0;
1846 return chars_.substr(pos);
1856 return chars_.substr(pos,
count);
1866 return substr(start_index);
1904 std::for_each(chars_.begin(), chars_.end(), [&](
auto c) {result += static_cast<value_type>(std::tolower(c));});
1912 if constexpr (std::is_same_v<char, char_t>)
return chars_;
1913 else return __xtd_convert_to_string<char>(chars_);
1923 if constexpr (std::is_same_v<xtd::char16, char_t>)
return chars_;
1924 else return __xtd_convert_to_string<xtd::char16>(chars_);
1930 if constexpr (std::is_same_v<xtd::char32, char_t>)
return chars_;
1931 else return __xtd_convert_to_string<xtd::char32>(chars_);
1934#if defined(__xtd__cpp_lib_char8_t)
1938 if constexpr (std::is_same_v<xtd::char8, char_t>)
return chars_;
1939 else return __xtd_convert_to_string<xtd::char8>(chars_);
1947 std::for_each(chars_.begin(), chars_.end(), [&](
auto c) {result += static_cast<value_type>(std::toupper(c));});
1954 if constexpr (std::is_same_v<xtd::wchar, char_t>)
return chars_;
1955 else return __xtd_convert_to_string<xtd::wchar>(chars_);
2014 template<
class object_t>
2015 [[deprecated(
"Replaced by typeof_<object_t>().name() - Will be removed in version 0.4.0.")]]
2021 template<
class object_t>
2022 [[deprecated(
"Replaced by typeof_(object).name() - Will be removed in version 0.4.0.")]]
2028 [[deprecated(
"Replaced by typeof_(info).name() - Will be removed in version 0.4.0.")]]
2089 static int32 compare(
const basic_string& str_a,
xtd::size index_a,
const basic_string& str_b,
xtd::size index_b,
xtd::size length,
bool ignore_case) {
return compare(str_a, index_a, str_b, index_b,
length, ignore_case ?
xtd::string_comparison::ordinal_ignore_case :
xtd::string_comparison::ordinal);}
2118 template<
class object_a_t,
class object_b_t,
class object_c_t,
class object_d_t>
2119 static basic_string concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c, object_d_t obj_d)
noexcept {
return format(
"{}{}{}{}", obj_a, obj_b, obj_c, obj_d);}
2131 template<
class object_a_t,
class object_b_t,
class object_c_t>
2132 static basic_string concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c)
noexcept {
return format(
"{}{}{}", obj_a, obj_b, obj_c);}
2142 template<
class object_a_t,
class object_b_t>
2150 template<
class other_
char_t>
2152 static basic_string concat(
const std::initializer_list<basic_string>& values)
noexcept {
2154 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
2157 static basic_string concat(
const std::initializer_list<const_pointer>& values)
noexcept {
2159 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
2162 template<
class other_
char_t>
2163 static basic_string concat(
const std::initializer_list<const other_char_t*>& values)
noexcept {
2165 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
2172 template<
class object_t>
2175 template<
class object_t>
2178 for (
const auto& arg : args)
2179 result +=
format(
"{}", arg);
2186 template<
class value_t>
2188 return format(
"{}", value);
2212 if constexpr (std::is_same_v<char, char_t>)
return __xtd_demangle(name.
chars());
2213 else return __xtd_demangle(__xtd_convert_to_string<char>(name.
chars()));
2227 template<
class char_a_t,
class char_b_t>
2243 template<
class char_a_t,
class char_b_t>
2252 template<
class ...args_t>
2259 template<
class object_t>
2260 [[deprecated(
"Replaced by typeof_<object_t>().full_name() - Will be removed in version 0.4.0.")]]
2266 template<
class object_t>
2267 [[deprecated(
"Replaced by typeof_(object).full_name() - Will be removed in version 0.4.0.")]]
2273 [[deprecated(
"Replaced by typeof_(info).full_name() - Will be removed in version 0.4.0.")]]
2287 template<
class collection_t>
2291 for (
const auto& item : values)
2302 template<
class collection_t>
2312 template<
class collection_t>
2317 for (
const auto& item : values) {
2319 if (++
i >= index +
count)
break;
2325 template<
class value_t>
2327 template<
class value_t>
2329 template<
class value_t>
2336 template<
class value_t>
2338 if constexpr (std::is_same_v<char, char_t>)
return xtd::parse<value_t>(str.
chars());
2339 else return xtd::parse<value_t>(__xtd_convert_to_string<char>(str.
chars()));
2401 template<
class ...args_t>
2408 template<
class value_t>
2411 value = parse<value_t>(str);
2428 return chars_[index];
2439 if constexpr(std::is_same<char_t, char>::value) chars_ = str.chars_;
2440 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2447 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = str.chars_;
2448 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2455 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = str.chars_;
2456 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2459#if defined(__xtd__cpp_lib_char8_t)
2464 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = str.chars_;
2465 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2473 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = str.chars_;
2474 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2482 if constexpr(std::is_same<char_t, char>::value) chars_ = std::move(str.chars_);
2483 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2490 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = std::move(str.chars_);
2491 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2498 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = std::move(str.chars_);
2499 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2502#if defined(__xtd__cpp_lib_char8_t)
2507 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = std::move(str.chars_);
2508 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2516 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = std::move(str.chars_);
2517 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2525 if constexpr(std::is_same<char_t, char>::value) chars_ = str;
2526 else chars_ = __xtd_convert_to_string<value_type>(str);
2533 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = str;
2534 else chars_ = __xtd_convert_to_string<value_type>(str);
2541 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = str;
2542 else chars_ = __xtd_convert_to_string<value_type>(str);
2545#if defined(__xtd__cpp_lib_char8_t)
2550 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = str;
2551 else chars_ = __xtd_convert_to_string<value_type>(str);
2559 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = str;
2560 else chars_ = __xtd_convert_to_string<value_type>(str);
2568 if constexpr(std::is_same<char_t, char>::value) chars_ = std::move(str);
2569 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2576 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = std::move(str);
2577 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2584 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = std::move(str);
2585 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2588#if defined(__xtd__cpp_lib_char8_t)
2593 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = std::move(str);
2594 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2602 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = std::move(str);
2603 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2613 if constexpr (std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str);
2614 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str));
2623 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str);
2624 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str));
2633 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str);
2634 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str));
2637#if defined(__xtd__cpp_lib_char8_t)
2644 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str);
2645 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str));
2655 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str);
2656 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
2681#if defined(__xtd__cpp_lib_char8_t)
2719#if defined(__xtd__cpp_lib_char8_t)
2740 if constexpr (std::is_same_v<char, char_t>) chars_ += str.chars_;
2741 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2748 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ += str.chars_;
2749 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2756 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ += str.chars_;
2757 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2760#if defined(__xtd__cpp_lib_char8_t)
2765 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ += str.chars_;
2766 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2774 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ += str.chars_;
2775 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2783 if constexpr (std::is_same_v<char, char_t>) chars_ += std::move(str.chars_);
2784 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2791 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ += std::move(str.chars_);
2792 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2799 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ += std::move(str.chars_);
2800 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2803#if defined(__xtd__cpp_lib_char8_t)
2808 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ += std::move(str.chars_);
2809 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2817 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ += std::move(str.chars_);
2818 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2826 if constexpr (std::is_same_v<char, char_t>) chars_ += str;
2827 else chars_ += __xtd_convert_to_string<value_type>(str);
2834 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ += str;
2835 else chars_ += __xtd_convert_to_string<value_type>(str);
2842 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ += str;
2843 else chars_ += __xtd_convert_to_string<value_type>(str);
2846#if defined(__xtd__cpp_lib_char8_t)
2851 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ += str;
2852 else chars_ += __xtd_convert_to_string<value_type>(str);
2860 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ += str;
2861 else chars_ += __xtd_convert_to_string<value_type>(str);
2885#if defined(__xtd__cpp_lib_char8_t)
2922#if defined(__xtd__cpp_lib_char8_t)
2966#if defined(__xtd__cpp_lib_char8_t)
2992 auto result = std::move(lhs);
2993 result += std::move(rhs);
3001 auto result = std::move(lhs);
3002 result += std::move(rhs);
3010 auto result = std::move(lhs);
3011 result += std::move(rhs);
3014#if defined(__xtd__cpp_lib_char8_t)
3020 auto result = std::move(lhs);
3021 result += std::move(rhs);
3030 auto result = std::move(lhs);
3031 result += std::move(rhs);
3040 auto result = std::move(lhs);
3049 auto result = std::move(lhs);
3058 auto result = std::move(lhs);
3062#if defined(__xtd__cpp_lib_char8_t)
3068 auto result = std::move(lhs);
3078 auto result = std::move(lhs);
3089 result += std::move(rhs);
3098 result += std::move(rhs);
3107 result += std::move(rhs);
3110#if defined(__xtd__cpp_lib_char8_t)
3117 result += std::move(rhs);
3127 result += std::move(rhs);
3158#if defined(__xtd__cpp_lib_char8_t)
3185 if constexpr (std::is_same_v<char, char_t>) result += rhs.
chars();
3186 else result += __xtd_convert_to_string<char>(rhs.
chars());
3195 if constexpr (std::is_same_v<xtd::char16, char_t>) result += rhs.
chars();
3196 else result += __xtd_convert_to_string<xtd::char16>(rhs.
chars());
3205 if constexpr (std::is_same_v<xtd::char32, char_t>) result += rhs.
chars();
3206 else result += __xtd_convert_to_string<xtd::char32>(rhs.
chars());
3209#if defined(__xtd__cpp_lib_char8_t)
3216 if constexpr (std::is_same_v<xtd::char8, char_t>) result += rhs.
chars();
3217 else result += __xtd_convert_to_string<xtd::char8>(rhs.
chars());
3227 if constexpr (std::is_same_v<xtd::wchar, char_t>) result += rhs.
chars();
3228 else result += __xtd_convert_to_string<xtd::wchar>(rhs.
chars());
3259#if defined(__xtd__cpp_lib_char8_t)
3285 auto result = std::move(lhs);
3294 auto result = std::move(lhs);
3303 auto result = std::move(lhs);
3307#if defined(__xtd__cpp_lib_char8_t)
3313 auto result = std::move(lhs);
3323 auto result = std::move(lhs);
3355#if defined(__xtd__cpp_lib_char8_t)
3382 result += std::move(rhs);
3391 result += std::move(rhs);
3400 result += std::move(rhs);
3404#if defined(__xtd__cpp_lib_char8_t)
3411 result += std::move(rhs);
3421 result += std::move(rhs);
3452#if defined(__xtd__cpp_lib_char8_t)
3478 auto result = std::move(lhs);
3487 auto result = std::move(lhs);
3496 auto result = std::move(lhs);
3500#if defined(__xtd__cpp_lib_char8_t)
3506 auto result = std::move(lhs);
3516 auto result = std::move(lhs);
3548#if defined(__xtd__cpp_lib_char8_t)
3575 result += std::move(rhs);
3584 result += std::move(rhs);
3593 result += std::move(rhs);
3596#if defined(__xtd__cpp_lib_char8_t)
3603 result += std::move(rhs);
3613 result += std::move(rhs);
3627 if constexpr (std::is_same_v<char, char_t>)
return stream << str.
chars();
3628 else return stream << __xtd_convert_to_string<char>(str.
chars());
3647 auto s = std::basic_string<char> {};
3661 auto s = std::basic_string<xtd::wchar> {};
3672#if defined(__xtd__cpp_lib_char8_t)
3677 static const
xtd::array<value_type> default_split_separators;
3678 static const
xtd::array<value_type> default_trim_chars;
3680 template<class arg_t>
3681 static auto convert_param(arg_t&& arg) noexcept {
3682 if constexpr(std::is_same<std::remove_cv_t<std::remove_reference_t<arg_t>>, std::string>::value)
return std::forward<arg_t>(arg).c_str();
3683 else if constexpr(std::is_same<std::remove_cv_t<std::remove_reference_t<arg_t>>, std::u16string>::value)
return std::forward<arg_t>(arg).c_str();
3684 else if constexpr(std::is_same<std::remove_cv_t<std::remove_reference_t<arg_t>>, std::u32string>::value)
return std::forward<arg_t>(arg).c_str();
3685#if defined(__xtd__cpp_lib_char8_t)
3686 else if constexpr(std::is_same<std::remove_cv_t<std::remove_reference_t<arg_t>>, std::u8string>::value)
return std::forward<arg_t>(arg).c_str();
3688 else if constexpr(std::is_same<std::remove_cv_t<std::remove_reference_t<arg_t>>, std::wstring>::value)
return std::forward<arg_t>(arg).c_str();
3689 else if constexpr(std::is_same<std::remove_cv_t<std::remove_reference_t<arg_t>>,
basic_string>::value)
return std::forward<arg_t>(arg).c_str();
3690 else return std::forward<arg_t>(arg);
3694 auto length = full_name.last_index_of(
"<");
3696 if (full_name.last_index_of(
"::", 0,
length) ==
npos)
return full_name;
3697 return full_name.substring(full_name.last_index_of(
"::", 0,
length) + 2);
3700 typename base_type::iterator to_base_type_iterator(
iterator value)
const noexcept {
3701 if (value ==
begin())
return chars_.begin();
3702 if (value ==
end())
return chars_.end();
3703 return chars_.begin() + (value -
begin());
3706 iterator to_iterator(
typename base_type::iterator value)
const noexcept {
3707 if (value == chars_.begin())
return begin();
3708 if (value == chars_.end())
return end();
3709 return begin() + (value - chars_.begin());
3716#define __XTD_BASIC_STRING_INTERNAL__
3718#undef __XTD_BASIC_STRING_INTERNAL__
Contains xtd::array definitions.
Contains __format method.
Contains string definitions.
Contains __xtd_std_version definitions.
Contains xtd::basic_string class.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:59
Represents text as a sequence of character units.
Definition basic_string.hpp:71
basic_string(const basic_string< xtd::char32 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:146
basic_string trim(value_type trim_char) const noexcept
Removes all leading and trailing occurrences of a character specified from the specified xtd::basic_s...
basic_string(const xtd::char8 *str, xtd::size count)
Initializes a new instance of xtd::basic_string with specified substring and count characters.
Definition basic_string.hpp:627
basic_string(const basic_string< xtd::char32 > &str, xtd::size index, xtd::size count)
Initializes a new instance of xtd::basic_string with specified substring at index and count character...
Definition basic_string.hpp:329
std::basic_string< char_t, traits_t, allocator_t > base_type
Represents the basic string base type.
Definition basic_string.hpp:78
static basic_string concat(object_a_t obj_a, object_b_t obj_b) noexcept
Concatenates two specified instances of object.
Definition basic_string.hpp:2143
xtd::size index_of(value_type value) const noexcept
Reports the index of the first occurrence of the specified character in this basic_string.
Definition basic_string.hpp:1445
static int32 compare(const basic_string &str_a, const basic_string &str_b, xtd::string_comparison comparison_type) noexcept
Compares two specified basic_string objects using the specified rules, and returns an integer that in...
Definition basic_string.hpp:2062
basic_string trim_end(const xtd::array< value_type > &trim_chars) const noexcept
Removes all trailing occurrences of a set of characters specified in an array from the specified xtd:...
basic_string to_lower() const noexcept
Returns a copy of the current xtd::basic_string converted to lowercase.
Definition basic_string.hpp:1902
static value_t parse(const basic_string &str)
Converts a basic_string into a value_t type.
Definition basic_string.hpp:2337
basic_string pad_left(xtd::size total_width) const noexcept
Right-aligns the characters in this basic_string, padding with spaces on the left for a specified tot...
Definition basic_string.hpp:1575
basic_string(const basic_string< char > &str, xtd::size index)
Initializes a new instance of xtd::basic_string with specified substring at index.
Definition basic_string.hpp:207
static const basic_string empty_string
Represents the empty basic_string.
Definition basic_string.hpp:116
basic_string(xtd::size count, xtd::char16 character, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified count copies of character and specifie...
Definition basic_string.hpp:442
basic_string(const basic_string< xtd::char8 > &str, xtd::size index)
Initializes a new instance of xtd::basic_string with specified substring at index.
Definition basic_string.hpp:235
bool ends_with(const basic_string &value, xtd::string_comparison comparison_type) const noexcept
Determines whether the end of this basic_string matches the specified basic_string when compared usin...
Definition basic_string.hpp:1168
static basic_string class_name(const object_t &object)
Gets the class name of the specified object.
Definition basic_string.hpp:2023
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.hpp:1366
basic_string(const xtd::char32 *str, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified string to copy, and allocator.
Definition basic_string.hpp:579
constexpr basic_string(const string_view_like_t &string_view)
Initializes a new instance of xtd::basic_string with specified string view of substring and allocator...
Definition basic_string.hpp:776
allocator_type get_allocator() const
Returns the allocator associated with the string.
Definition basic_string.hpp:1394
xtd::size index_of(value_type value, xtd::size start_index, xtd::size count) const
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:1457
basic_string(xtd::char16 character, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified count copies of character and specifie...
Definition basic_string.hpp:491
basic_string(const xtd::char16 *str, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring, count characters and alloca...
Definition basic_string.hpp:654
xtd::size index_of(value_type value, xtd::size start_index) const
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:1450
basic_string trim() const noexcept
Removes all leading and trailing occurrences of white-space characters from the specified xtd::basic_...
Definition basic_string.hpp:1962
xtd::array< basic_string > split() const noexcept
Splits this basic_string into substrings that are based on the default white-space characters....
const_reverse_iterator rbegin() const
Returns a reverse iterator to the first character of the string.
Definition basic_string.hpp:918
basic_string(xtd::size count, xtd::char8 character)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:456
basic_string(std::initializer_list< xtd::char16 > il, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified initializer list and allocator.
Definition basic_string.hpp:822
basic_string(const xtd::char8 *str, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified string to copy, and allocator.
Definition basic_string.hpp:588
basic_string(const xtd::char32 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:538
size_type find_first_of(const basic_string &str) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string.hpp:1220
xtd::size index_of_any(const xtd::array< value_type > &values, xtd::size start_index) const
Reports the index of the first occurrence in this instance of any character in a specified array of c...
typename base_type::allocator_type allocator_type
Represents the basic string allocator type.
Definition basic_string.hpp:84
basic_string substring(xtd::size start_index, xtd::size length) const
Retrieves a substring from this instance. The substring starts at a specified character position and ...
Definition basic_string.hpp:1873
basic_string(char character, xtd::size count)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:477
basic_string(const xtd::char16 *str, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified string to copy, and allocator.
Definition basic_string.hpp:571
size_type find_last_of(char_t ch, size_type pos) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string.hpp:1346
bool ends_with(value_type value, bool ignore_case) const noexcept
Determines whether the end of this basic_string matches the specified character, ignoring or honoring...
Definition basic_string.hpp:1151
basic_string(std::initializer_list< char > il, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified initializer list and allocator.
Definition basic_string.hpp:818
basic_string(const char *str, xtd::size count)
Initializes a new instance of xtd::basic_string with specified substring and count characters.
Definition basic_string.hpp:605
enumerator_type get_enumerator() const noexcept override
Returns an enumerator that iterates through a collection.
Definition basic_string.hpp:1404
static basic_string demangle(const basic_string &name)
Gets demangled basic_string of name,.
Definition basic_string.hpp:2211
basic_string(xtd::wchar character, xtd::size count)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:515
basic_string(input_iterator_t first, input_iterator_t last, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified first and last iterators of substring ...
Definition basic_string.hpp:770
basic_string(xtd::size count, xtd::char8 character, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified count copies of character and specifie...
Definition basic_string.hpp:461
int32 compare(size_type pos1, size_type count1, const basic_string &str) const
Compares two character sequences.
Definition basic_string.hpp:977
typename xtd::collections::generic::enumerator< value_type > enumerator_type
Represents the basic string enumerator type.
Definition basic_string.hpp:108
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.hpp:1680
size_type find_last_not_of(char_t ch, size_type pos) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:1390
size_type rfind(const_pointer s) const
Finds the last substring that is equal to the given character sequence. The search begins at xtd::bas...
Definition basic_string.hpp:1686
size_type rfind(const basic_string &str) const
Finds the last substring that is equal to the given character sequence. The search begins at xtd::bas...
Definition basic_string.hpp:1666
basic_string(const basic_string< xtd::char8 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:153
basic_string(xtd::wchar character, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified count copies of character and specifie...
Definition basic_string.hpp:520
basic_string(const basic_string< xtd::char8 > &str, xtd::size index, xtd::size count)
Initializes a new instance of xtd::basic_string with specified substring at index and count character...
Definition basic_string.hpp:340
basic_string(const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified allocator.
static bool try_parse(const basic_string &str, value_t &value) noexcept
Try to convert a basic_string into a value_t type.
Definition basic_string.hpp:2409
basic_string(input_iterator_t first, input_iterator_t last)
Initializes a new instance of xtd::basic_string with specified first and last iterators of substring.
Definition basic_string.hpp:764
virtual const base_type & get_base_type() const noexcept
Returns the underlying base type.
Definition basic_string.hpp:1398
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.hpp:1291
xtd::size last_index_of(const basic_string &value, xtd::size start_index) const
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:1514
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.hpp:1328
basic_string(const basic_string< xtd::wchar > &str, const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
Definition basic_string.hpp:198
static basic_string full_class_name(const std::type_info &info)
Gets the fully qualified class name of the specified object, including the namespace of the specified...
Definition basic_string.hpp:2274
typename base_type::const_pointer const_pointer
Represents the basic string const pointer type.
Definition basic_string.hpp:96
friend std::basic_istream< char > & operator>>(std::basic_istream< char > &stream, basic_string &str)
Input stream operator. Behaves as a FormattedInputFunction. After constructing and checking the sentr...
Definition basic_string.hpp:3646
basic_string(std::initializer_list< xtd::wchar > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.hpp:813
int32 compare(size_type pos1, size_type count1, const_pointer s) const
Compares two character sequences.
Definition basic_string.hpp:1067
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.hpp:1335
size_type find_first_not_of(const basic_string &str) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:1264
static basic_string concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c, object_d_t obj_d) noexcept
Concatenates four specified instances of object.
Definition basic_string.hpp:2119
bool starts_with(const basic_string &value) const noexcept
Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic...
Definition basic_string.hpp:1818
basic_string(xtd::char8 character, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified count copies of character and specifie...
Definition basic_string.hpp:510
virtual bool contains(const basic_string &value) const noexcept
Returns a value indicating whether a specified substring occurs within this basic_string.
Definition basic_string.hpp:1122
size_type find_first_of(const basic_string &str, size_type pos) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string.hpp:1226
static bool equals(const basic_string &a, const basic_string &b, bool ignore_case) noexcept
Determines whether two specified xtd::basic_string objects have the same value, ignoring or honoring ...
Definition basic_string.hpp:2236
basic_string insert(xtd::size start_index, const basic_string &value) const
Inserts a specified instance of basic_string at a specified index position in this instance.
Definition basic_string.hpp:1492
basic_string(const basic_string< xtd::char16 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:140
basic_string(basic_string &&str, const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified string to move and allocator.
Definition basic_string.hpp:422
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.hpp:1247
basic_string to_upper() const noexcept
Returns a copy of the current xtd::basic_string converted to uppercase.
Definition basic_string.hpp:1945
int32 compare(size_type pos1, size_type count1, const_pointer s, size_type count2) const
Compares two character sequences.
Definition basic_string.hpp:1090
basic_string(const std::basic_string< char > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:691
typename base_type::traits_type traits_type
Represents the basic string traits type.
Definition basic_string.hpp:80
const base_type & chars() const noexcept
Returns a reference to the underlying base type.
Definition basic_string.hpp:875
basic_string trim_start(value_type trim_char) const noexcept
Removes all leading occurrences of a character specified from the specified xtd::basic_string .
xtd::size last_index_of(const basic_string &value, xtd::size start_index, xtd::size count) const
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:1521
basic_string(const std::basic_string< xtd::char16 > &str, const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
Definition basic_string.hpp:732
static basic_string join(const basic_string &separator, const collection_t &values, xtd::size index, xtd::size count)
Concatenates a specified separator basic_string between each element of a specified Object array,...
Definition basic_string.hpp:2313
basic_string substring(xtd::size start_index) const
Retrieves a substring from this instance. The substring starts at a specified character position and ...
Definition basic_string.hpp:1864
typename base_type::pointer pointer
Represents the basic string pointer type.
Definition basic_string.hpp:94
xtd::size index_of_any(const xtd::array< value_type > &values) const noexcept
Reports the index of the first occurrence in this instance of any character in a specified array of c...
basic_string(char character, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified count copies of character and specifie...
Definition basic_string.hpp:482
size_type find_first_not_of(char_t ch) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:1296
basic_string substr(size_type pos, size_type count) const
Returns a substring [pos, pos + count). If the requested substring extends past the end of the string...
Definition basic_string.hpp:1854
int32 compare_to(const basic_string &value) const noexcept override
Compares this instance with a specified xtd::basic_string object and indicates whether this instance ...
Definition basic_string.hpp:1113
xtd::array< value_type > to_char_array() const noexcept
Copies the characters in this instance to a Unicode character array.
basic_string quoted() const
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML.
Definition basic_string.hpp:1602
static int32 compare(const basic_string &str_a, xtd::size index_a, const basic_string &str_b, xtd::size index_b, xtd::size length, xtd::string_comparison comparison_type)
Compares substrings of two specified basic_string objects using the specified rules,...
Definition basic_string.hpp:2103
basic_string< char > to_string() const noexcept override
Converts the value of this instance to a xtd::basic_string <char>.
Definition basic_string.hpp:1911
typename base_type::const_reference const_reference
Represents the basic string const referecne type.
Definition basic_string.hpp:92
basic_string(std::initializer_list< xtd::char32 > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.hpp:805
static basic_string join(const basic_string &separator, const collection_t &values, xtd::size index)
Concatenates a specified separator basic_string between each element of a specified object array,...
Definition basic_string.hpp:2303
size_type find(const_pointer s) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string.hpp:1196
basic_string< xtd::wchar > to_wstring() const noexcept
Converts the value of this instance to a xtd::basic_string <xtd::wchar>.
Definition basic_string.hpp:1953
basic_string(const std::basic_string< xtd::char16 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:697
basic_string(const xtd::wchar *str, xtd::size count)
Initializes a new instance of xtd::basic_string with specified substring and count characters.
Definition basic_string.hpp:635
basic_string(const basic_string< xtd::char8 > &str, const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
Definition basic_string.hpp:190
basic_string remove(xtd::size start_index) const
Deletes all the characters from this basic_string beginning at a specified position and continuing th...
Definition basic_string.hpp:1623
basic_string(const basic_string< xtd::wchar > &str, xtd::size index)
Initializes a new instance of xtd::basic_string with specified substring at index.
Definition basic_string.hpp:245
const_iterator begin() const override
Returns an iterator to the first character of the string.
Definition basic_string.hpp:849
friend std::basic_ostream< char > & operator<<(std::basic_ostream< char > &stream, const basic_string &str)
Output stream operator. Behaves as a FormattedOutputFunction. After constructing and checking the sen...
Definition basic_string.hpp:3626
basic_string(const basic_string< xtd::wchar > &str, xtd::size index, xtd::size count)
Initializes a new instance of xtd::basic_string with specified substring at index and count character...
Definition basic_string.hpp:351
size_type find_last_not_of(char_t ch) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:1384
const_iterator end() const override
Returns an iterator to the character following the last character of the string. This character acts ...
Definition basic_string.hpp:900
constexpr basic_string(const string_view_like_t &string_view, size_type index, size_type count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified string view of substring and allocator...
Definition basic_string.hpp:795
basic_string(std::initializer_list< xtd::char32 > il, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified initializer list and allocator.
Definition basic_string.hpp:826
basic_string(const basic_string< xtd::char32 > &str, xtd::size index, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring at index,...
Definition basic_string.hpp:385
basic_string remove(xtd::size start_index, xtd::size count) const
Deletes all the characters from this basic_string beginning at a specified position and continuing th...
Definition basic_string.hpp:1628
xtd::size last_index_of(value_type value) const noexcept
Reports the index of the last occurrence of the specified character in this tring.
Definition basic_string.hpp:1529
static basic_string class_name()
Gets the class name of the object_t.
Definition basic_string.hpp:2016
static basic_string class_name(const std::type_info &info)
Gets the class name of the specified object.
Definition basic_string.hpp:2029
const_iterator cend() const override
Returns an iterator to the character following the last character of the string. This character acts ...
Definition basic_string.hpp:879
basic_string(xtd::size count, xtd::wchar character)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:466
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.hpp:1372
basic_string trim_start(const xtd::array< value_type > &trim_chars) const noexcept
Removes all leading occurrences of a set of characters specified in an array from the specified xtd::...
basic_string(const basic_string< xtd::wchar > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:160
static bool equals(const basic_string &a, const basic_string &b) noexcept
Determines whether two specified xtd::basic_string objects have the same value.
Definition basic_string.hpp:2221
bool is_empty() const noexcept
Indicates whether this basic_string is an empty basic_string ("").
Definition basic_string.hpp:1503
basic_string(const std::basic_string< char > &str, const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
Definition basic_string.hpp:725
size_type find(value_type ch) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string.hpp:1208
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.hpp:1704
static int32 compare(const basic_string &str_a, const basic_string &str_b, bool ignore_case) noexcept
Compares two specified basic_string objects, ignoring or honoring their case, and returns an integer ...
Definition basic_string.hpp:2051
static int32 compare(const basic_string &str_a, const basic_string &str_b) noexcept
Compares two specified basic_string objects and returns an integer that indicates their relative posi...
Definition basic_string.hpp:2040
typename xtd::collections::generic::ienumerable< char_t >::iterator iterator
Represents the basic string iterator type.
Definition basic_string.hpp:99
basic_string(const basic_string< xtd::char32 > &str, xtd::size index)
Initializes a new instance of xtd::basic_string with specified substring at index.
Definition basic_string.hpp:225
typename base_type::const_reverse_iterator const_reverse_iterator
Represents the basic string const reverse iterator type.
Definition basic_string.hpp:106
static basic_string concat(const basic_string &str_a, const basic_string &str_b, const basic_string &str_c) noexcept
Concatenates three specified instances of basic_string.
Definition basic_string.hpp:2125
basic_string(const basic_string< xtd::char16 > &str, xtd::size index, xtd::size count)
Initializes a new instance of xtd::basic_string with specified substring at index and count character...
Definition basic_string.hpp:319
basic_string(const char *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:524
basic_string(const basic_string< xtd::char16 > &str, xtd::size index, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring at index and allocator.
Definition basic_string.hpp:266
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.hpp:914
basic_string quoted(value_type delimiter) const
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified...
Definition basic_string.hpp:1607
int32 compare_to(const object &value) const
Compares this instance with a specified xtd::object and indicates whether this instance precedes,...
Definition basic_string.hpp:1101
basic_string(const basic_string< xtd::char16 > &str, xtd::size index)
Initializes a new instance of xtd::basic_string with specified substring at index.
Definition basic_string.hpp:216
basic_string pad_right(xtd::size total_width, char32 padding_char) const noexcept
Left-aligns the characters in this basic_string, padding with spaces on the right for a specified tot...
Definition basic_string.hpp:1596
basic_string(xtd::char32 character, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified count copies of character and specifie...
Definition basic_string.hpp:500
basic_string(const xtd::char8 *str, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring, count characters and alloca...
Definition basic_string.hpp:673
int32 compare(size_type pos1, size_type count1, const basic_string &str, size_type pos2, size_type count2) const
Compares two character sequences.
Definition basic_string.hpp:1026
basic_string(std::initializer_list< char > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.hpp:799
static bool equals(const char_a_t *a, const char_b_t *b, bool ignore_case) noexcept
Determines whether two specified xtd::basic_string objects have the same value, ignoring or honoring ...
Definition basic_string.hpp:2244
static basic_string concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c) noexcept
Concatenates three specified instances of object.
Definition basic_string.hpp:2132
basic_string(const basic_string< char > &str, xtd::size index, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring at index and allocator.
Definition basic_string.hpp:256
basic_string replace(const basic_string &old_string, const basic_string &new_string) const noexcept
Replaces all occurrences of a specified basic_string in this basic_string with another specified basi...
Definition basic_string.hpp:1645
basic_string(const basic_string< xtd::char16 > &str, const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
Definition basic_string.hpp:175
xtd::size get_hash_code() const noexcept override
Returns the hash code for this basic_string.
Definition basic_string.hpp:1402
bool starts_with(value_type value, bool ignore_case) const noexcept
Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic...
Definition basic_string.hpp:1810
typename base_type::size_type size_type
Represents the basic string size type.
Definition basic_string.hpp:86
virtual bool contains(value_type value) const noexcept
Returns a value indicating whether a specified char occurs within this basic_string.
Definition basic_string.hpp:1118
size_type find_last_not_of(const basic_string &str) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:1352
size_type find_first_not_of(const basic_string &str, size_type pos) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:1270
bool ends_with(value_type value) const noexcept
Determines whether the end of this basic_string matches the specified character.
Definition basic_string.hpp:1146
basic_string(const basic_string< xtd::wchar > &str, xtd::size index, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring at index and allocator.
Definition basic_string.hpp:298
size_type rfind(value_type ch) const
Finds the last substring that is equal to the given character sequence. The search begins at xtd::bas...
Definition basic_string.hpp:1698
static basic_string concat(const basic_string &str_a, const basic_string &str_b, const basic_string &str_c, const basic_string &str_d) noexcept
Concatenates four specified instances of basic_string.
Definition basic_string.hpp:2111
static basic_string join(const basic_string separator, const collection_t &values) noexcept
Concatenates a specified separator basic_string between each element of a specified object array,...
Definition basic_string.hpp:2288
const_reverse_iterator crend() const
Returns a reverse iterator to the character following the last character of the string....
Definition basic_string.hpp:883
basic_string(xtd::char8 character, xtd::size count)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:505
basic_string(const xtd::wchar *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:554
xtd::size last_index_of(value_type value, xtd::size start_index, xtd::size count) const
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:1543
basic_string(const char *str, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified string to copy, and allocator.
Definition basic_string.hpp:563
basic_string & operator=(const basic_string< char > &str) noexcept
Copy assignment operator. Replaces the contents with a copy of the contents of str.
Definition basic_string.hpp:2438
const_reverse_iterator crbegin() const
Returns a reverse iterator to the first character of the string.
Definition basic_string.hpp:871
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.hpp:1234
basic_string(const basic_string< xtd::char8 > &str, xtd::size index, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring at index and allocator.
Definition basic_string.hpp:287
xtd::size index_of(const basic_string &value, xtd::size start_index, xtd::size count) const
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:1437
basic_string(const basic_string< xtd::char32 > &str, xtd::size index, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring at index and allocator.
Definition basic_string.hpp:276
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.hpp:892
basic_string(basic_string &&)=default
Initializes a new instance of xtd::basic_string with specified string to move.
static constexpr size_type npos
This is a special value equal to the maximum value representable by the type xtd::size.
Definition basic_string.hpp:119
static basic_string concat(const basic_string &str_a, const basic_string &str_b) noexcept
Concatenates two specified instances of basic_string.
Definition basic_string.hpp:2137
size_type find(const basic_string &str) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string.hpp:1176
basic_string trim_end() const noexcept
Removes all trailing occurrences of white-space characters from the specified xtd::basic_string.
Definition basic_string.hpp:1978
xtd::size last_index_of_any(const xtd::array< value_type > &values) const noexcept
Reports the index of the last occurrence in this instance of any character in a specified array of ch...
static bool equals(const char_a_t *a, const char_b_t *b) noexcept
Determines whether two specified xtd::basic_string objects have the same value.
Definition basic_string.hpp:2228
static int32 compare(const basic_string &str_a, xtd::size index_a, const basic_string &str_b, xtd::size index_b, xtd::size length)
Compares substrings of two specified basic_string objects and returns an integer that indicates their...
Definition basic_string.hpp:2075
const_reverse_iterator rend() const
Returns a reverse iterator to the character following the last character of the string....
Definition basic_string.hpp:922
basic_string(const basic_string< char > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:133
xtd::size index_of(const basic_string &value) const noexcept
Reports the index of the first occurrence of the specified basic_string in this basic_string.
Definition basic_string.hpp:1425
size_type find_first_not_of(char_t ch, size_type pos) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:1302
basic_string(xtd::char16 character, xtd::size count)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:486
int32 compare(const_pointer s) const
Compares two character sequences.
Definition basic_string.hpp:1045
bool equals(const object &obj) const noexcept override
Determines whether this instance and a specified object, which must also be a xtd::basic_string objec...
Definition basic_string.hpp:1127
size_type find_first_of(char_t ch) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string.hpp:1252
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.hpp:1284
size_type size() const noexcept
Returns the number of char_t elements in the string, i.e. std::distance(begin(), end()).
Definition basic_string.hpp:926
const_reference at(size_type pos) const
Returns a reference to the character at specified location pos.
Definition basic_string.hpp:935
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.hpp:1278
basic_string(const basic_string< char > &str, xtd::size index, xtd::size count)
Initializes a new instance of xtd::basic_string with specified substring at index and count character...
Definition basic_string.hpp:309
basic_string 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.hpp:1844
basic_string to_title_case() const noexcept
Converts the current basic_string to title case (except for words that are entirely in uppercase,...
basic_string replace(value_type old_char, value_type new_char) const noexcept
Replaces all occurrences of a specified char_t in this basic_string with another specified char_t.
Definition basic_string.hpp:1639
size_type length() const noexcept
Gets the number of characters in the current xtd::basic_string object.
Definition basic_string.hpp:910
xtd::size index_of_any(const xtd::array< value_type > &values, xtd::size start_index, xtd::size count) const
Reports the index of the first occurrence in this instance of any character in a specified array of c...
bool ends_with(const basic_string &value, bool ignore_case) const noexcept
Determines whether the end of this basic_string instance matches the specified basic_string,...
Definition basic_string.hpp:1163
basic_string(xtd::size count, xtd::char32 character)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:446
basic_string(xtd::size count, xtd::wchar character, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified count copies of character and specifie...
Definition basic_string.hpp:472
basic_string(const std::basic_string< xtd::char32 > &str, const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
Definition basic_string.hpp:739
static basic_string concat(const xtd::array< object_t > &args) noexcept
Concatenates the basic_string representations of the elements in a specified object array.
basic_string(const char *str, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring, count characters and alloca...
Definition basic_string.hpp:645
static bool is_empty(const xtd::basic_string< value_type, traits_type, allocator_type > &string) noexcept
Indicates whether the specifeid basic_string is an empty basic_string ("").
Definition basic_string.hpp:2279
constexpr basic_string(const string_view_like_t &string_view, size_type index, size_type count)
Initializes a new instance of xtd::basic_string with specified string view of substring and allocator...
Definition basic_string.hpp:788
basic_string(xtd::size count, char character, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified count copies of character and specifie...
Definition basic_string.hpp:433
basic_string(const xtd::char16 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:531
basic_string & operator+=(const basic_string< char > &str)
Addition assignment operator. Appends additional characters to the string.
Definition basic_string.hpp:2739
typename base_type::value_type value_type
Represents the basic string value type.
Definition basic_string.hpp:82
typename base_type::reverse_iterator reverse_iterator
Represents the basic string reverse iterator type.
Definition basic_string.hpp:104
basic_string(const xtd::char16 *str, xtd::size count)
Initializes a new instance of xtd::basic_string with specified substring and count characters.
Definition basic_string.hpp:612
bool equals(const basic_string &value, bool ignore_case) const noexcept
Determines whether this instance and another specified xtd::basic_string object have the same value,...
Definition basic_string.hpp:1138
basic_string pad_right(xtd::size total_width) const noexcept
Left-aligns the characters in this basic_string, padding with spaces on the right for a specified tot...
Definition basic_string.hpp:1589
size_type find_last_of(const basic_string &str, size_type pos) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string.hpp:1314
static basic_string full_class_name()
Gets the fully qualified class name of the objec_t, including the namespace of the objec_t.
Definition basic_string.hpp:2261
basic_string(std::initializer_list< xtd::char16 > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.hpp:802
basic_string trim_end(value_type trim_char) const noexcept
Removes all trailing occurrences of a character specified from the specified xtd::basic_string .
basic_string(xtd::size count, xtd::char16 character)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:437
int32 compare(size_type pos1, size_type count1, const basic_string &str, size_type pos2) const
Compares two character sequences.
Definition basic_string.hpp:1001
static basic_string concat(value_t value) noexcept
Creates the basic_string representation of a specified object.
Definition basic_string.hpp:2187
xtd::size last_index_of_any(const xtd::array< value_type > &values, xtd::size start_index, xtd::size count) const
Reports the index of the last occurrence in this instance of any character in a specified array of ch...
basic_string(std::initializer_list< xtd::char8 > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.hpp:809
static basic_string concat(const xtd::array< basic_string > &values) noexcept
Concatenates the elements of a specified basic_string array.
const_reference front() const
Returns reference to the first character in the string. The behavior is undefined if empty() is true.
Definition basic_string.hpp:905
basic_string trim_start() const noexcept
Removes all leading occurrences of white-space characters from the specified xtd::basic_string.
Definition basic_string.hpp:1994
bool ends_with(const basic_string &value) const noexcept
Determines whether the end of this basic_string matches the specified basic_string.
Definition basic_string.hpp:1158
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.hpp:1240
basic_string()=default
Initializes a new instance of xtd::basic_string.
basic_string(const basic_string< xtd::char32 > &str, const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
Definition basic_string.hpp:182
static basic_string full_class_name(const object_t &object)
Gets the fully qualified class name of the specified object, including the namespace of the specified...
Definition basic_string.hpp:2268
xtd::size last_index_of(const basic_string &value) const noexcept
Reports the index of the last occurrence of the specified basic_string in this basic_string.
Definition basic_string.hpp:1508
basic_string pad_left(xtd::size total_width, char32 padding_char) const noexcept
Right-aligns the characters in this basic_string, padding with spaces on the left for a specified tot...
Definition basic_string.hpp:1582
basic_string(const xtd::char32 *str, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring, count characters and alloca...
Definition basic_string.hpp:663
bool equals(const basic_string &value) const noexcept override
Determines whether this instance and another specified xtd::basic_string object have the same value.
Definition basic_string.hpp:1132
bool starts_with(value_type value) const noexcept
Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic...
Definition basic_string.hpp:1804
const_iterator cbegin() const override
Returns an iterator to the first character of the string.
Definition basic_string.hpp:867
basic_string(xtd::size count, char character)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:428
size_type find_last_of(char_t ch) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string.hpp:1340
basic_string(const xtd::char8 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:546
basic_string(std::initializer_list< xtd::char8 > il, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified initializer list and allocator.
Definition basic_string.hpp:831
size_type rfind(const basic_string &str, size_type pos) const
Finds the last substring that is equal to the given character sequence. The search begins at pos and ...
Definition basic_string.hpp:1672
static int32 compare(const basic_string &str_a, xtd::size index_a, const basic_string &str_b, xtd::size index_b, xtd::size length, bool ignore_case)
Compares substrings of two specified basic_string objects, ignoring or honoring their case,...
Definition basic_string.hpp:2089
basic_string(const basic_string< xtd::wchar > &str, xtd::size index, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring at index,...
Definition basic_string.hpp:409
basic_string trim(const xtd::array< value_type > &trim_chars) const noexcept
Removes all leading and trailing occurrences of a set of characters specified in an array from the sp...
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.hpp:1379
basic_string< xtd::char8 > to_u8string() const noexcept
Converts the value of this instance to a xtd::basic_string <xtd::char8>.
Definition basic_string.hpp:1937
basic_string(xtd::char32 character, xtd::size count)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:495
basic_string(const basic_string< xtd::char8 > &str, xtd::size index, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring at index,...
Definition basic_string.hpp:397
xtd::size last_index_of_any(const xtd::array< value_type > &values, xtd::size start_index) const
Reports the index of the last occurrence in this instance of any character in a specified array of ch...
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.hpp:1214
size_type find_last_of(const basic_string &str) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string.hpp:1308
int32 compare(const basic_string &str) const
Compares two character sequences.
Definition basic_string.hpp:955
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.hpp:859
bool empty() const noexcept
Checks if the string has no characters, i.e. whether begin() == end().
Definition basic_string.hpp:896
basic_string(const xtd::wchar *str, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring, count characters and alloca...
Definition basic_string.hpp:683
typename base_type::reference reference
Represents the basic string referecne type.
Definition basic_string.hpp:90
basic_string(std::initializer_list< xtd::wchar > il, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified initializer list and allocator.
Definition basic_string.hpp:836
basic_string(const std::basic_string< xtd::wchar > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:717
basic_string(const xtd::wchar *str, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified string to copy, and allocator.
Definition basic_string.hpp:597
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.hpp:1322
basic_string(const std::basic_string< xtd::char8 > &str, const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
Definition basic_string.hpp:747
typename xtd::collections::generic::ienumerable< char_t >::const_iterator const_iterator
Represents the basic string const iterator type.
Definition basic_string.hpp:102
constexpr basic_string(const string_view_like_t &string_view, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified string view of substring and allocator...
Definition basic_string.hpp:781
basic_string substr() const
Returns a substring [pos, pos + count). If the requested substring extends past the end of the string...
Definition basic_string.hpp:1838
typename base_type::difference_type difference_type
Represents the basic string difference type.
Definition basic_string.hpp:88
size_type find_last_not_of(const basic_string &str, size_type pos) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:1358
size_type find(const basic_string &str, size_type pos) const
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_string.hpp:1182
xtd::size index_of(const basic_string &value, xtd::size start_index) const
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:1430
basic_string(const std::basic_string< xtd::char32 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:703
friend basic_string operator+(const basic_string &lhs, const basic_string< char > &rhs)
Addition operator. Returns a string containing characters from lhs followed by the characters from rh...
Definition basic_string.hpp:2943
size_type find_first_of(char_t ch, size_type pos) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string.hpp:1258
basic_string(const xtd::char32 *str, xtd::size count)
Initializes a new instance of xtd::basic_string with specified substring and count characters.
Definition basic_string.hpp:619
basic_string(const std::basic_string< xtd::char8 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:710
basic_string(const basic_string< char > &str, xtd::size index, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring at index,...
Definition basic_string.hpp:363
bool starts_with(const basic_string &value, bool ignore_case) const noexcept
Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic...
Definition basic_string.hpp:1824
basic_string(const basic_string< xtd::char16 > &str, xtd::size index, xtd::size count, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified substring at index,...
Definition basic_string.hpp:374
basic_string(const std::basic_string< xtd::wchar > &str, const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
Definition basic_string.hpp:755
basic_string quoted(value_type delimiter, value_type escape) const
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified...
Definition basic_string.hpp:1613
basic_string(const basic_string< char > &str, const allocator_type &allocator) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy and allocator.
Definition basic_string.hpp:168
basic_string< xtd::char16 > to_u16string() const noexcept
Converts the value of this instance to a xtd::basic_string <xtd::char16>.
Definition basic_string.hpp:1922
basic_string(xtd::size count, xtd::char32 character, const allocator_type &allocator)
Initializes a new instance of xtd::basic_string with specified count copies of character and specifie...
Definition basic_string.hpp:451
xtd::array< value_type > to_array() const noexcept
Copies the characters in this instance to a Unicode character array.
basic_string< xtd::char32 > to_u32string() const noexcept
Converts the value of this instance to a xtd::basic_string <xtd::char32>.
Definition basic_string.hpp:1929
const_reference operator[](xtd::size index) const
Returns a reference to the character at specified location index.
Definition basic_string.hpp:2426
xtd::size last_index_of(value_type value, xtd::size start_index) const
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:1535
bool starts_with(const basic_string &value, xtd::string_comparison comparison_type) const noexcept
Determines whether the end of this basic_string matches the specified basic_string when compared usin...
Definition basic_string.hpp:1829
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.hpp:1190
size_type capacity() const noexcept
Returns the number of characters that the string has currently allocated space for.
Definition basic_string.hpp:863
const_reference back() const
Returns reference to the last character in the string.
Definition basic_string.hpp:845
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.hpp:1203
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.hpp:1693
virtual iterator end()
Returns an iterator to the element following the last element of the enumarable.
Definition enumerable_iterators.hpp:173
virtual const_iterator end() const
Returns an iterator to the element following the last element of the enumarable.
Definition enumerable_iterators.hpp:170
virtual const_iterator begin() const
Returns an iterator to the first element of the enumarable.
Definition enumerable_iterators.hpp:155
virtual const_iterator cbegin() const
Returns an iterator to the first element of the enumarable.
Definition enumerable_iterators.hpp:162
virtual const_iterator cend() const
Returns an iterator to the element following the last element of the enumarable.
Definition enumerable_iterators.hpp:166
virtual iterator begin()
Returns an iterator to the first element of the enumarable.
Definition enumerable_iterators.hpp:158
size_t count() const noexcept
Returns the number of elements in current sequence.
Definition enumerable.hpp:209
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:36
typename xtd::collections::generic::extensions::enumerable_iterators< type_t, xtd::collections::generic::ienumerable< type_t > >::iterator iterator
Represents the iterator of xtd::collections::generic::ienumerable value type.
Definition ienumerable.hpp:44
typename xtd::collections::generic::extensions::enumerable_iterators< type_t, xtd::collections::generic::ienumerable< type_t > >::const_iterator const_iterator
Represents the const iterator of xtd::collections::generic::ienumerable value type.
Definition ienumerable.hpp:46
Supports a simple iteration over a generic collection.
Definition ienumerator.hpp:58
static xtd::size combine(args_t... values) noexcept
Combines values into a hash code.
Definition hash_code.hpp:70
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.hpp:21
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Contains xtd::collections::generic::ienumerable <type_t> interface.
@ argument
The argument is not valid.
@ index_out_of_range
The index is out of range.
@ argument_out_of_range
The argument is out of range.
@ null_pointer
The pointer is null.
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:27
wchar_t wchar
Represents a wide character.
Definition wchar.hpp:24
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
null_ptr null
Represents a null pointer value.
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:26
string_comparison
Specifies the culture, case, and sort rules to be used by certain overloads of the xtd::string::compa...
Definition string_comparison.hpp:14
string_split_options
Specifies whether applicable xtd::string::split method overloads include or omit empty substrings fro...
Definition string_split_options.hpp:14
@ ordinal
Compare strings using ordinal (binary) sort rules.
@ ordinal_ignore_case
Compare strings using ordinal (binary) sort rules and ignoring the case of the strings being compared...
@ separator
The Separator key.
@ escape
The ESC (ESCAPE) key.
Contains xtd::hash_code class.
Contains xtd::icomparable interface.
Contains xtd::iequatable interface.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::null pointer valiue.
Contains xtd::object class.
Contains xtd::parse methods.
Contains xtd::string_comparison enum class.
Contains xtd::string_split_options enum class.
Supports a simple iteration over a generic collection.
Definition enumerator.hpp:38
Contains xtd::to_string methods.
Contains xtd fundamental types.
Contains unused_ keyword.