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<
typename ...args_t>
41template<
typename target_t,
typename source_t>
42std::basic_string<target_t> __xtd_convert_to_string(std::basic_string<source_t>&& str)
noexcept;
43template<
typename target_t,
typename 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;
48void __throw_basic_string_argument_exception(
const char* file,
xtd::uint32 line,
const char* func);
49void __throw_basic_string_argument_out_of_range_exception(
const char* file,
xtd::uint32 line,
const char* func);
50void __throw_basic_string_format_exception(
const char* file,
xtd::uint32 line,
const char* func);
51void __throw_basic_string_format_exception_close_bracket(
const char* file,
xtd::uint32 line,
const char* func);
52void __throw_basic_string_format_exception_open_bracket(
const char* file,
xtd::uint32 line,
const char* func);
53void __throw_basic_string_format_exception_start_colon(
const char* file,
xtd::uint32 line,
const char* func);
54void __throw_basic_string_index_out_of_range_exception(
const char* file,
xtd::uint32 line,
const char* func);
55void __throw_basic_string_null_pointer_exception(
const char* file,
xtd::uint32 line,
const char* func);
78 template<
typename char_t,
typename traits_t,
typename allocator_t>
86 using base_type = std::basic_string<char_t, traits_t, allocator_t>;
142 if constexpr (std::is_same_v<char, char_t>) chars_ = str.chars_;
143 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
149 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = str.chars_;
150 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
155 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = str.chars_;
156 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
158#if defined(__xtd__cpp_lib_char8_t)
162 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = str.chars_;
163 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
169 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = str.chars_;
170 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
177 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str.chars_, allocator);
178 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str.chars_), allocator);
184 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str.chars_, allocator);
185 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str.chars_), allocator);
191 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str.chars_, allocator);
192 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str.chars_), allocator);
194#if defined(__xtd__cpp_lib_char8_t)
199 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str.chars_, allocator);
200 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str.chars_), allocator);
207 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str.chars_, allocator);
208 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str.chars_), allocator);
216 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
217 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str.chars_, index);
218 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index)));
225 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
226 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str.chars_, index);
227 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index)));
234 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
235 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str.chars_, index);
236 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index)));
238#if defined(__xtd__cpp_lib_char8_t)
244 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
245 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str.chars_, index);
246 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index)));
254 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
255 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str.chars_, index);
256 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index)));
265 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
266 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str.chars_, index, allocator);
267 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index)), allocator);
275 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
276 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str.chars_, index, allocator);
277 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index)), allocator);
285 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
286 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str.chars_, index, allocator);
287 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index)), allocator);
289#if defined(__xtd__cpp_lib_char8_t)
296 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
297 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str.chars_, index, allocator);
298 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index)), allocator);
307 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
308 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str.chars_, index, allocator);
309 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index)), allocator);
318 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
319 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str.chars_, index, count);
320 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index, count)));
328 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
329 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str.chars_, index, count);
330 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index, count)));
338 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
339 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str.chars_, index, count);
340 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index, count)));
342#if defined(__xtd__cpp_lib_char8_t)
349 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
350 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str.chars_, index, count);
351 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index, count)));
360 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
361 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str.chars_, index, count);
362 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index, count)));
372 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
373 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str.chars_, index, count, allocator);
374 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index, count)), allocator);
383 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
384 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str.chars_, index, count, allocator);
385 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index, count)), allocator);
394 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
395 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str.chars_, index, count, allocator);
396 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index, count)), allocator);
398#if defined(__xtd__cpp_lib_char8_t)
406 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
407 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str.chars_, index, count, allocator);
408 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index, count)), allocator);
418 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
419 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str.chars_, index, count, allocator);
420 else chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index, count)), allocator);
460#if defined(__xtd__cpp_lib_char8_t)
509#if defined(__xtd__cpp_lib_char8_t)
533 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
534 if constexpr (std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str);
535 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str));
540 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
541 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str);
542 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str));
547 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
548 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str);
549 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str));
551#if defined(__xtd__cpp_lib_char8_t)
555 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
556 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str);
557 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str));
563 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
564 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str);
565 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
572 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
573 if constexpr (std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str, allocator);
574 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str), allocator);
580 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
581 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str, allocator);
582 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str), allocator);
588 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
589 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str, allocator);
590 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str), allocator);
592#if defined(__xtd__cpp_lib_char8_t)
597 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
598 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str, allocator);
599 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str), allocator);
606 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
607 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str);
608 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
614 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
615 if constexpr (std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str, count);
616 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str, count));
621 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
622 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str, count);
623 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str, count));
628 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
629 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str, count);
630 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str, count));
632#if defined(__xtd__cpp_lib_char8_t)
636 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
637 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str, count);
638 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str, count));
644 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
645 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str, count);
646 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str, count));
654 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
655 if constexpr (std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str, count, allocator);
656 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str, count), allocator);
663 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
664 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str, count, allocator);
665 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str, count), allocator);
672 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
673 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str, count, allocator);
674 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str, count), allocator);
676#if defined(__xtd__cpp_lib_char8_t)
682 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
683 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str, count, allocator);
684 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str, count), allocator);
692 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
693 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str, count, allocator);
694 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str, count), allocator);
700 if constexpr (std::is_same_v<char, char_t>) chars_ = str;
701 else chars_ = __xtd_convert_to_string<value_type>(str);
706 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = str;
707 else chars_ = __xtd_convert_to_string<value_type>(str);
712 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = str;
713 else chars_ = __xtd_convert_to_string<value_type>(str);
715#if defined(__xtd__cpp_lib_char8_t)
719 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = str;
720 else chars_ = __xtd_convert_to_string<value_type>(str);
726 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = str;
727 else chars_ = __xtd_convert_to_string<value_type>(str);
734 if constexpr (std::is_same_v<char, char_t>) chars_ =
base_type(str, allocator);
735 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str), allocator);
741 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ =
base_type(str, allocator);
742 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str), allocator);
748 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ =
base_type(str, allocator);
749 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str), allocator);
751#if defined(__xtd__cpp_lib_char8_t)
756 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ =
base_type(str, allocator);
757 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str), allocator);
764 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ =
base_type(str, allocator);
765 else chars_ =
base_type(__xtd_convert_to_string<value_type>(str), allocator);
771 template<
typename input_iterator_t>
772 basic_string(input_iterator_t first, input_iterator_t last) : chars_(first, last) {}
777 template<
typename input_iterator_t>
783 template<
typename string_view_like_t>
784 explicit constexpr basic_string(
const string_view_like_t& string_view) : chars_(string_view) {}
788 template<
typename string_view_like_t>
795 template<
typename string_view_like_t>
802 template<
typename string_view_like_t>
814#if defined(__xtd__cpp_lib_char8_t)
835#if defined(__xtd__cpp_lib_char8_t)
904 bool empty() const noexcept {
return chars_.empty();}
1110 if (!
dynamic_cast<const basic_string*
>(&value)) __throw_basic_string_argument_exception(__FILE__, __LINE__, __func__);
1147 if (ignore_case)
return to_upper().chars_ == value.to_upper().chars_;
1148 return chars_ == value.chars_;
1178 return rfind(value) + value.size() ==
size();
1415 explicit basic_string_enumerator(
const basic_string& chars) : chars_(chars) {}
1417 const value_type& current()
const override {
return chars_[index_];}
1419 bool move_next()
override {
return ++index_ < chars_.size();}
1421 void reset()
override {index_ = basic_string::npos;}
1427 return {new_ptr<basic_string_enumerator>(*
this)};
1446 if (start_index >
size() || start_index + count >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1447 auto result =
find(value, start_index);
1448 return result > start_index + count ?
npos : result;
1466 if (start_index >
size() || start_index + count >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1467 auto result =
find(value, start_index);
1468 return result > start_index + count ?
npos : result;
1501 if (start_index >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1502 auto result = *
this;
1503 result.chars_.insert(start_index, value);
1510 [[deprecated(
"Replaced by xtd::basic_string::is_empty(const xtd::basic_string&) - Will be removed in version 0.4.0.")]]
1530 if (start_index >
size() || start_index + count >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1531 auto result =
rfind(value, start_index + count - value.
size());
1532 return result < start_index ?
npos : result;
1552 if (start_index >
size() || start_index + count >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1553 auto result =
rfind(value, start_index + count - 1);
1554 return result < start_index ?
npos : result;
1622 std::wstringstream ss;
1623 if constexpr (std::is_same_v<xtd::wchar, value_type>) ss << std::quoted(chars_, delimiter,
escape);
1624 else ss << std::quoted(__xtd_convert_to_string<xtd::wchar>(chars_),
static_cast<xtd::wchar>(delimiter),
static_cast<xtd::wchar>(
escape));
1637 if (start_index >
size() || start_index + count >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1638 auto result = *
this;
1639 result.chars_.erase(start_index, count);
1654 auto result = *
this;
1655 auto old_size = old_string.
size();
1656 auto new_size = new_string.size();
1659 index = result.find(old_string, index);
1660 if (index ==
npos)
break;
1661 if (old_size == new_size) result.chars_.replace(index, old_size, new_string);
1663 result.chars_.erase(index, old_string.size());
1664 result.chars_.insert(index, new_string);
1666 index += new_string.size();
1820 return find(value) == 0;
1839 return find(value) == 0;
1853 if (pos >
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1854 return chars_.substr(pos);
1863 if (pos >
size() || pos + count >
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1864 return chars_.substr(pos, count);
1873 if (start_index >
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1874 return substr(start_index);
1882 if (start_index >
size() || start_index +
length >
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1912 std::for_each(chars_.begin(), chars_.end(), [&](
auto c) {result += static_cast<value_type>(std::tolower(c));});
1920 if constexpr (std::is_same_v<char, char_t>)
return chars_;
1921 else return __xtd_convert_to_string<char>(chars_);
1931 if constexpr (std::is_same_v<xtd::char16, char_t>)
return chars_;
1932 else return __xtd_convert_to_string<xtd::char16>(chars_);
1938 if constexpr (std::is_same_v<xtd::char32, char_t>)
return chars_;
1939 else return __xtd_convert_to_string<xtd::char32>(chars_);
1942#if defined(__xtd__cpp_lib_char8_t)
1946 if constexpr (std::is_same_v<xtd::char8, char_t>)
return chars_;
1947 else return __xtd_convert_to_string<xtd::char8>(chars_);
1955 std::for_each(chars_.begin(), chars_.end(), [&](
auto c) {result += static_cast<value_type>(std::toupper(c));});
1962 if constexpr (std::is_same_v<xtd::wchar, char_t>)
return chars_;
1963 else return __xtd_convert_to_string<xtd::wchar>(chars_);
2022 template<
typename object_t>
2023 [[deprecated(
"Replaced by typeof_<object_t>().name() - Will be removed in version 0.4.0.")]]
2029 template<
typename object_t>
2030 [[deprecated(
"Replaced by typeof_(object).name() - Will be removed in version 0.4.0.")]]
2036 [[deprecated(
"Replaced by typeof_(info).name() - Will be removed in version 0.4.0.")]]
2097 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);}
2126 template<
typename object_a_t,
typename object_b_t,
typename object_c_t,
typename object_d_t>
2127 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);}
2139 template<
typename object_a_t,
typename object_b_t,
typename object_c_t>
2140 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);}
2150 template<
typename object_a_t,
typename object_b_t>
2158 template<
typename other_
char_t>
2160 static basic_string concat(
const std::initializer_list<basic_string>& values)
noexcept {
2162 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
2165 static basic_string concat(
const std::initializer_list<const_pointer>& values)
noexcept {
2167 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
2170 template<
typename other_
char_t>
2171 static basic_string concat(
const std::initializer_list<const other_char_t*>& values)
noexcept {
2173 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
2180 template<
typename object_t>
2183 template<
typename object_t>
2186 for (
const auto& arg : args)
2187 result +=
format(
"{}", arg);
2194 template<
typename value_t>
2196 return format(
"{}", value);
2220 if constexpr (std::is_same_v<char, char_t>)
return __xtd_demangle(name.
chars());
2221 else return __xtd_demangle(__xtd_convert_to_string<char>(name.
chars()));
2235 template<
typename char_a_t,
typename char_b_t>
2251 template<
typename char_a_t,
typename char_b_t>
2260 template<
typename ...args_t>
2267 template<
typename object_t>
2268 [[deprecated(
"Replaced by typeof_<object_t>().full_name() - Will be removed in version 0.4.0.")]]
2274 template<
typename object_t>
2275 [[deprecated(
"Replaced by typeof_(object).full_name() - Will be removed in version 0.4.0.")]]
2281 [[deprecated(
"Replaced by typeof_(info).full_name() - Will be removed in version 0.4.0.")]]
2295 template<
typename collection_t>
2304 template<
typename collection_t>
2314 template<
typename collection_t>
2316 if (index > values.size() || index + count > values.size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
2319 for (
const auto& item : values) {
2322 result +=
format(
"{}", item);
2324 if (++
i >= index + count)
break;
2329 template<
typename value_t>
2331 template<
typename value_t>
2333 template<
typename value_t>
2340 template<
typename value_t>
2342 if constexpr (std::is_same_v<char, char_t>)
return xtd::parse<value_t>(str.
chars());
2343 else return xtd::parse<value_t>(__xtd_convert_to_string<char>(str.
chars()));
2405 template<
typename ... args_t>
2412 template<
typename value_t>
2415 value = parse<value_t>(str);
2431 if (index >=
length()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
2432 return chars_[index];
2443 if constexpr(std::is_same<char_t, char>::value) chars_ = str.chars_;
2444 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2451 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = str.chars_;
2452 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2459 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = str.chars_;
2460 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2463#if defined(__xtd__cpp_lib_char8_t)
2468 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = str.chars_;
2469 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2477 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = str.chars_;
2478 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2486 if constexpr(std::is_same<char_t, char>::value) chars_ = std::move(str.chars_);
2487 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2494 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = std::move(str.chars_);
2495 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2502 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = std::move(str.chars_);
2503 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2506#if defined(__xtd__cpp_lib_char8_t)
2511 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = std::move(str.chars_);
2512 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2520 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = std::move(str.chars_);
2521 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2529 if constexpr(std::is_same<char_t, char>::value) chars_ = str;
2530 else chars_ = __xtd_convert_to_string<value_type>(str);
2537 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = str;
2538 else chars_ = __xtd_convert_to_string<value_type>(str);
2545 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = str;
2546 else chars_ = __xtd_convert_to_string<value_type>(str);
2549#if defined(__xtd__cpp_lib_char8_t)
2554 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = str;
2555 else chars_ = __xtd_convert_to_string<value_type>(str);
2563 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = str;
2564 else chars_ = __xtd_convert_to_string<value_type>(str);
2572 if constexpr(std::is_same<char_t, char>::value) chars_ = std::move(str);
2573 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2580 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = std::move(str);
2581 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2588 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = std::move(str);
2589 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2592#if defined(__xtd__cpp_lib_char8_t)
2597 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = std::move(str);
2598 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2606 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = std::move(str);
2607 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2616 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
2617 if constexpr (std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str);
2618 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str));
2626 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
2627 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str);
2628 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str));
2636 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
2637 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str);
2638 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str));
2641#if defined(__xtd__cpp_lib_char8_t)
2647 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
2648 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str);
2649 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str));
2658 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
2659 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str);
2660 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
2685#if defined(__xtd__cpp_lib_char8_t)
2723#if defined(__xtd__cpp_lib_char8_t)
2744 if constexpr (std::is_same_v<char, char_t>) chars_ += str.chars_;
2745 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2752 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ += str.chars_;
2753 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2760 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ += str.chars_;
2761 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2764#if defined(__xtd__cpp_lib_char8_t)
2769 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ += str.chars_;
2770 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2778 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ += str.chars_;
2779 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2787 if constexpr (std::is_same_v<char, char_t>) chars_ += std::move(str.chars_);
2788 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2795 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ += std::move(str.chars_);
2796 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2803 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ += std::move(str.chars_);
2804 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2807#if defined(__xtd__cpp_lib_char8_t)
2812 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ += std::move(str.chars_);
2813 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2821 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ += std::move(str.chars_);
2822 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2830 if constexpr (std::is_same_v<char, char_t>) chars_ += str;
2831 else chars_ += __xtd_convert_to_string<value_type>(str);
2838 if constexpr (std::is_same_v<xtd::char16, char_t>) chars_ += str;
2839 else chars_ += __xtd_convert_to_string<value_type>(str);
2846 if constexpr (std::is_same_v<xtd::char32, char_t>) chars_ += str;
2847 else chars_ += __xtd_convert_to_string<value_type>(str);
2850#if defined(__xtd__cpp_lib_char8_t)
2855 if constexpr (std::is_same_v<xtd::char8, char_t>) chars_ += str;
2856 else chars_ += __xtd_convert_to_string<value_type>(str);
2864 if constexpr (std::is_same_v<xtd::wchar, char_t>) chars_ += str;
2865 else chars_ += __xtd_convert_to_string<value_type>(str);
2889#if defined(__xtd__cpp_lib_char8_t)
2926#if defined(__xtd__cpp_lib_char8_t)
2970#if defined(__xtd__cpp_lib_char8_t)
2996 auto result = std::move(lhs);
2997 result += std::move(rhs);
3005 auto result = std::move(lhs);
3006 result += std::move(rhs);
3014 auto result = std::move(lhs);
3015 result += std::move(rhs);
3018#if defined(__xtd__cpp_lib_char8_t)
3024 auto result = std::move(lhs);
3025 result += std::move(rhs);
3034 auto result = std::move(lhs);
3035 result += std::move(rhs);
3044 auto result = std::move(lhs);
3053 auto result = std::move(lhs);
3062 auto result = std::move(lhs);
3066#if defined(__xtd__cpp_lib_char8_t)
3072 auto result = std::move(lhs);
3082 auto result = std::move(lhs);
3093 result += std::move(rhs);
3102 result += std::move(rhs);
3111 result += std::move(rhs);
3114#if defined(__xtd__cpp_lib_char8_t)
3121 result += std::move(rhs);
3131 result += std::move(rhs);
3162#if defined(__xtd__cpp_lib_char8_t)
3189 if constexpr (std::is_same_v<char, char_t>) result += rhs.
chars();
3190 else result += __xtd_convert_to_string<char>(rhs.
chars());
3199 if constexpr (std::is_same_v<xtd::char16, char_t>) result += rhs.
chars();
3200 else result += __xtd_convert_to_string<xtd::char16>(rhs.
chars());
3209 if constexpr (std::is_same_v<xtd::char32, char_t>) result += rhs.
chars();
3210 else result += __xtd_convert_to_string<xtd::char32>(rhs.
chars());
3213#if defined(__xtd__cpp_lib_char8_t)
3220 if constexpr (std::is_same_v<xtd::char8, char_t>) result += rhs.
chars();
3221 else result += __xtd_convert_to_string<xtd::char8>(rhs.
chars());
3231 if constexpr (std::is_same_v<xtd::wchar, char_t>) result += rhs.
chars();
3232 else result += __xtd_convert_to_string<xtd::wchar>(rhs.
chars());
3263#if defined(__xtd__cpp_lib_char8_t)
3289 auto result = std::move(lhs);
3298 auto result = std::move(lhs);
3307 auto result = std::move(lhs);
3311#if defined(__xtd__cpp_lib_char8_t)
3317 auto result = std::move(lhs);
3327 auto result = std::move(lhs);
3359#if defined(__xtd__cpp_lib_char8_t)
3386 result += std::move(rhs);
3395 result += std::move(rhs);
3404 result += std::move(rhs);
3408#if defined(__xtd__cpp_lib_char8_t)
3415 result += std::move(rhs);
3425 result += std::move(rhs);
3456#if defined(__xtd__cpp_lib_char8_t)
3482 auto result = std::move(lhs);
3491 auto result = std::move(lhs);
3500 auto result = std::move(lhs);
3504#if defined(__xtd__cpp_lib_char8_t)
3510 auto result = std::move(lhs);
3520 auto result = std::move(lhs);
3552#if defined(__xtd__cpp_lib_char8_t)
3579 result += std::move(rhs);
3588 result += std::move(rhs);
3597 result += std::move(rhs);
3600#if defined(__xtd__cpp_lib_char8_t)
3607 result += std::move(rhs);
3617 result += std::move(rhs);
3631 if constexpr (std::is_same_v<char, char_t>)
return stream << str.
chars();
3632 else return stream << __xtd_convert_to_string<char>(str.
chars());
3651 auto s = std::basic_string<char> {};
3665 auto s = std::basic_string<xtd::wchar> {};
3676#if defined(__xtd__cpp_lib_char8_t)
3681 static const
xtd::array<value_type> default_split_separators;
3682 static const
xtd::array<value_type> default_trim_chars;
3684 template<typename arg_t>
3685 static auto convert_param(arg_t&& arg) noexcept {
3686 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();
3687 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();
3688 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();
3689#if defined(__xtd__cpp_lib_char8_t)
3690 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();
3692 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();
3693 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();
3694 else return std::forward<arg_t>(arg);
3698 auto length = full_name.last_index_of(
"<");
3700 if (full_name.last_index_of(
"::", 0,
length) ==
npos)
return full_name;
3701 return full_name.substring(full_name.last_index_of(
"::", 0,
length) + 2);
3704 typename base_type::iterator to_base_type_iterator(
iterator value)
const noexcept {
3705 if (value ==
begin())
return chars_.begin();
3706 if (value ==
end())
return chars_.end();
3707 return chars_.begin() + (value -
begin());
3710 iterator to_iterator(
typename base_type::iterator value)
const noexcept {
3711 if (value == chars_.begin())
return begin();
3712 if (value == chars_.end())
return end();
3713 return begin() + (value - chars_.begin());
3720#define __XTD_BASIC_STRING_INTERNAL__
3721#include "basic_string.hpp"
3722#undef __XTD_BASIC_STRING_INTERNAL__
Contains array definitions.
Contains __format method.
Contains string definitions.
Contains __xtd_std_version definitions.
Represents text as a sequence of character units.
Definition basic_string.h:79
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.h:154
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.h:635
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.h:337
std::basic_string< char_t, traits_t, allocator_t > base_type
Represents the basic string base type.
Definition basic_string.h:86
static basic_string concat(object_a_t obj_a, object_b_t obj_b) noexcept
Concatenates two specified instances of object.
Definition basic_string.h:2151
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.h:1453
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.h:2070
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.h:1910
static value_t parse(const basic_string &str)
Converts a basic_string into a value_t type.
Definition basic_string.h:2341
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.h:1583
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.h:215
static const basic_string empty_string
Represents the empty basic_string.
Definition basic_string.h:124
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.h:450
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.h:243
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.h:1176
static basic_string class_name(const object_t &object)
Gets the class name of the specified object.
Definition basic_string.h:2031
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.h:1374
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.h:587
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.h:784
allocator_type get_allocator() const
Returns the allocator associated with the string.
Definition basic_string.h:1402
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.h:1465
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.h:499
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.h:662
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.h:1458
basic_string trim() const noexcept
Removes all leading and trailing occurrences of white-space characters from the specified xtd::basic_...
Definition basic_string.h:1970
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.h:926
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.h:464
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.h:830
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.h:596
basic_string(const xtd::char32 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.h:546
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.h:1228
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.h:92
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.h:1881
basic_string(char character, xtd::size count)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.h:485
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.h:579
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.h:1354
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.h:1159
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.h:826
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.h:613
enumerator_type get_enumerator() const noexcept override
Returns an enumerator that iterates through a collection.
Definition basic_string.h:1412
static basic_string demangle(const basic_string &name)
Gets demangled basic_string of name,.
Definition basic_string.h:2219
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.h:523
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.h:778
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.h:469
int32 compare(size_type pos1, size_type count1, const basic_string &str) const
Compares two character sequences.
Definition basic_string.h:985
typename xtd::collections::generic::enumerator< value_type > enumerator_type
Represents the basic string enumerator type.
Definition basic_string.h:116
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.h:1688
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.h:1398
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.h:1694
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.h:1674
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.h:161
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.h:528
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.h:348
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.h:2413
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.h:772
virtual const base_type & get_base_type() const noexcept
Returns the underlying base type.
Definition basic_string.h:1406
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.h:1299
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.h:1522
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.h:1336
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.h:206
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.h:2282
typename base_type::const_pointer const_pointer
Represents the basic string const pointer type.
Definition basic_string.h:104
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.h:3650
basic_string(std::initializer_list< xtd::wchar > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.h:821
int32 compare(size_type pos1, size_type count1, const_pointer s) const
Compares two character sequences.
Definition basic_string.h:1075
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.h:1343
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.h:1272
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.h:2127
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.h:1826
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.h:518
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.h:1130
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.h:1234
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.h:2244
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.h:1500
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.h:148
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.h:430
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.h:1255
basic_string to_upper() const noexcept
Returns a copy of the current xtd::basic_string converted to uppercase.
Definition basic_string.h:1953
int32 compare(size_type pos1, size_type count1, const_pointer s, size_type count2) const
Compares two character sequences.
Definition basic_string.h:1098
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.h:699
typename base_type::traits_type traits_type
Represents the basic string traits type.
Definition basic_string.h:88
const base_type & chars() const noexcept
Returns a reference to the underlying base type.
Definition basic_string.h:883
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.h:1529
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.h:740
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.h:2315
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.h:1872
typename base_type::pointer pointer
Represents the basic string pointer type.
Definition basic_string.h:102
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.h:490
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.h:1304
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.h:1862
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.h:1121
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.h:1610
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.h:2111
basic_string< char > to_string() const noexcept override
Converts the value of this instance to a xtd::basic_string <char>.
Definition basic_string.h:1919
typename base_type::const_reference const_reference
Represents the basic string const referecne type.
Definition basic_string.h:100
basic_string(std::initializer_list< xtd::char32 > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.h:813
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.h:2305
size_type find(const_pointer s) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string.h:1204
basic_string< xtd::wchar > to_wstring() const noexcept
Converts the value of this instance to a xtd::basic_string <xtd::wchar>.
Definition basic_string.h:1961
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.h:705
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.h:643
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.h:198
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.h:1631
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.h:253
const_iterator begin() const override
Returns an iterator to the first character of the string.
Definition basic_string.h:857
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.h:3630
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.h:359
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.h:1392
const_iterator end() const override
Returns an iterator to the character following the last character of the string. This character acts ...
Definition basic_string.h:908
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.h:803
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.h:834
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.h:393
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.h:1636
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.h:1537
static basic_string class_name()
Gets the class name of the object_t.
Definition basic_string.h:2024
static basic_string class_name(const std::type_info &info)
Gets the class name of the specified object.
Definition basic_string.h:2037
const_iterator cend() const override
Returns an iterator to the character following the last character of the string. This character acts ...
Definition basic_string.h:887
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.h:474
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.h:1380
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.h:168
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.h:2229
bool is_empty() const noexcept
Indicates whether this basic_string is an empty basic_string ("").
Definition basic_string.h:1511
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.h:733
size_type find(value_type ch) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string.h:1216
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.h:1712
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.h:2059
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.h:2048
typename xtd::collections::generic::ienumerable< char_t >::iterator iterator
Represents the basic string iterator type.
Definition basic_string.h:107
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.h:233
typename base_type::const_reverse_iterator const_reverse_iterator
Represents the basic string const reverse iterator type.
Definition basic_string.h:114
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.h:2133
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.h:327
basic_string(const char *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.h:532
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.h:274
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.h:922
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.h:1615
int32 compare_to(const object &value) const
Compares this instance with a specified xtd::object and indicates whether this instance precedes,...
Definition basic_string.h:1109
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.h:224
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.h:1604
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.h:508
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.h:681
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.h:1034
basic_string(std::initializer_list< char > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.h:807
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.h:2252
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.h:2140
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.h:264
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.h:1653
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.h:183
xtd::size get_hash_code() const noexcept override
Returns the hash code for this basic_string.
Definition basic_string.h:1410
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.h:1818
typename base_type::size_type size_type
Represents the basic string size type.
Definition basic_string.h:94
virtual bool contains(value_type value) const noexcept
Returns a value indicating whether a specified char occurs within this basic_string.
Definition basic_string.h:1126
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.h:1360
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.h:1278
bool ends_with(value_type value) const noexcept
Determines whether the end of this basic_string matches the specified character.
Definition basic_string.h:1154
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.h:306
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.h:1706
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.h:2119
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.h:2296
const_reverse_iterator crend() const
Returns a reverse iterator to the character following the last character of the string....
Definition basic_string.h:891
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.h:513
basic_string(const xtd::wchar *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.h:562
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.h:1551
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.h:571
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.h:2442
const_reverse_iterator crbegin() const
Returns a reverse iterator to the first character of the string.
Definition basic_string.h:879
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.h:1242
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.h:295
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.h:1445
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.h:284
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.h:900
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.h:127
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.h:2145
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.h:1184
basic_string trim_end() const noexcept
Removes all trailing occurrences of white-space characters from the specified xtd::basic_string.
Definition basic_string.h:1986
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.h:2236
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.h:2083
const_reverse_iterator rend() const
Returns a reverse iterator to the character following the last character of the string....
Definition basic_string.h:930
basic_string(const basic_string< char > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.h:141
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.h:1433
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.h:1310
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.h:494
int32 compare(const_pointer s) const
Compares two character sequences.
Definition basic_string.h:1053
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.h:1135
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.h:1260
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.h:1292
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
const_reference at(size_type pos) const
Returns a reference to the character at specified location pos.
Definition basic_string.h:943
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.h:1286
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.h:317
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.h:1852
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.h:1647
size_type length() const noexcept
Gets the number of characters in the current xtd::basic_string object.
Definition basic_string.h:918
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.h:1171
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.h:454
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.h:480
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.h:747
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.h:653
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.h:2287
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.h:796
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.h:441
basic_string(const xtd::char16 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.h:539
basic_string & operator+=(const basic_string< char > &str)
Addition assignment operator. Appends additional characters to the string.
Definition basic_string.h:2743
typename base_type::value_type value_type
Represents the basic string value type.
Definition basic_string.h:90
typename base_type::reverse_iterator reverse_iterator
Represents the basic string reverse iterator type.
Definition basic_string.h:112
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.h:620
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.h:1146
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.h:1597
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.h:1322
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.h:2269
basic_string(std::initializer_list< xtd::char16 > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.h:810
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.h:445
int32 compare(size_type pos1, size_type count1, const basic_string &str, size_type pos2) const
Compares two character sequences.
Definition basic_string.h:1009
static basic_string concat(value_t value) noexcept
Creates the basic_string representation of a specified object.
Definition basic_string.h:2195
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.h:817
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.h:913
basic_string trim_start() const noexcept
Removes all leading occurrences of white-space characters from the specified xtd::basic_string.
Definition basic_string.h:2002
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.h:1166
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.h:1248
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.h:190
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.h:2276
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.h:1516
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.h:1590
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.h:671
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.h:1140
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.h:1812
const_iterator cbegin() const override
Returns an iterator to the first character of the string.
Definition basic_string.h:875
basic_string(xtd::size count, char character)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.h:436
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.h:1348
basic_string(const xtd::char8 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.h:554
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.h:839
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.h:1680
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.h:2097
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.h:417
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.h:1387
basic_string< xtd::char8 > to_u8string() const noexcept
Converts the value of this instance to a xtd::basic_string <xtd::char8>.
Definition basic_string.h:1945
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.h:503
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.h:405
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.h:1222
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.h:1316
int32 compare(const basic_string &str) const
Compares two character sequences.
Definition basic_string.h:963
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.h:867
bool empty() const noexcept
Checks if the string has no characters, i.e. whether begin() == end().
Definition basic_string.h:904
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.h:691
typename base_type::reference reference
Represents the basic string referecne type.
Definition basic_string.h:98
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.h:844
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.h:725
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.h:605
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.h:1330
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.h:755
typename xtd::collections::generic::ienumerable< char_t >::const_iterator const_iterator
Represents the basic string const iterator type.
Definition basic_string.h:110
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.h:789
basic_string substr() const
Returns a substring [pos, pos + count). If the requested substring extends past the end of the string...
Definition basic_string.h:1846
typename base_type::difference_type difference_type
Represents the basic string difference type.
Definition basic_string.h:96
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.h:1366
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.h:1190
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.h:1438
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.h:711
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.h:2947
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.h:1266
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.h:627
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.h:718
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.h:371
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.h:1832
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.h:382
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.h:763
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.h:1621
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.h:176
basic_string< xtd::char16 > to_u16string() const noexcept
Converts the value of this instance to a xtd::basic_string <xtd::char16>.
Definition basic_string.h:1930
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.h:459
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.h:1937
const_reference operator[](xtd::size index) const
Returns a reference to the character at specified location index.
Definition basic_string.h:2430
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.h:1543
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.h:1837
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.h:1198
size_type capacity() const noexcept
Returns the number of characters that the string has currently allocated space for.
Definition basic_string.h:871
const_reference back() const
Returns reference to the last character in the string.
Definition basic_string.h:853
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.h:1211
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.h:1701
virtual const_iterator cend() const
Returns an iterator to the element following the last element of the enumarable.
Definition enumerable_iterators.h:209
virtual iterator begin()
Returns an iterator to the first element of the enumarable.
Definition enumerable_iterators.h:201
virtual iterator end()
Returns an iterator to the element following the last element of the enumarable.
Definition enumerable_iterators.h:216
virtual const_iterator cbegin() const
Returns an iterator to the first element of the enumarable.
Definition enumerable_iterators.h:205
virtual const_iterator end() const
Returns an iterator to the element following the last element of the enumarable.
Definition enumerable_iterators.h:213
virtual const_iterator begin() const
Returns an iterator to the first element of the enumarable.
Definition enumerable_iterators.h:198
Supports a simple iteration over a generic collection.
Definition enumerator.h:31
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.h:35
typename enumerable_iterators< type_t, ienumerable< type_t > >::const_iterator const_iterator
Represents the const iterator of xtd::collections::generic::ienumerable value type.
Definition ienumerable.h:43
typename enumerable_iterators< type_t, ienumerable< type_t > >::iterator iterator
Represents the iterator of xtd::collections::generic::ienumerable value type.
Definition ienumerable.h:41
Supports a simple iteration over a generic collection.
Definition ienumerator.h:58
static xtd::size combine(args_t... values) noexcept
Combines values into a hash code.
Definition hash_code.h:65
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.h:21
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
Contains xtd::collections::generic::ienumarable <type_t> interface.
char8_t char8
Represents a 8-bit unicode character.
Definition char8.h:27
wchar_t wchar
Represents a wide character.
Definition wchar.h:24
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
null_ptr null
Represents a null pointer value.
char16_t char16
Represents a 16-bit unicode character.
Definition char16.h:26
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.h:23
size_t size
Represents a size of any object in bytes.
Definition size.h:23
char32_t char32
Represents a 32-bit unicode character.
Definition char32.h:26
string_comparison
Specifies the culture, case, and sort rules to be used by certain overloads of the xtd::string::compa...
Definition string_comparison.h:14
string_split_options
Specifies whether applicable xtd::string::split method overloads include or omit empty substrings fro...
Definition string_split_options.h: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.h:10
std::vector< type_t > array
Definition __array_definition.h:18
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.
Contains xtd::to_string methods.
Contains unused_ keyword.
Contains xtd fundamental types.