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>;
149#if defined(__xtd__cpp_lib_char8_t)
170#if defined(__xtd__cpp_lib_char8_t)
186 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
187 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index)));
194 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
195 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index)));
202 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
203 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index)));
205#if defined(__xtd__cpp_lib_char8_t)
211 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
212 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index)));
220 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
221 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index)));
230 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
231 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index)), allocator);
239 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
240 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index)), allocator);
248 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
249 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index)), allocator);
251#if defined(__xtd__cpp_lib_char8_t)
258 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
259 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index)), allocator);
268 if (index > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
269 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index)), allocator);
278 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
279 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index, count)));
287 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
288 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index, count)));
296 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
297 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index, count)));
299#if defined(__xtd__cpp_lib_char8_t)
306 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
307 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index, count)));
316 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
317 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index, count)));
327 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
328 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<char>(str.chars_, index, count)), allocator);
337 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
338 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str.chars_, index, count)), allocator);
347 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
348 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str.chars_, index, count)), allocator);
350#if defined(__xtd__cpp_lib_char8_t)
358 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
359 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str.chars_, index, count)), allocator);
369 if (index + count > str.
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
370 chars_ =
base_type(__xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str.chars_, index, count)), allocator);
410#if defined(__xtd__cpp_lib_char8_t)
459#if defined(__xtd__cpp_lib_char8_t)
483 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
484 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str));
489 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
490 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str));
495 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
496 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str));
498#if defined(__xtd__cpp_lib_char8_t)
502 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
503 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str));
509 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
510 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
517 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
518 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str));
524 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
525 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str));
531 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
532 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str));
534#if defined(__xtd__cpp_lib_char8_t)
539 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
540 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str));
547 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
548 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
554 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
555 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str, count));
560 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
561 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str, count));
566 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
567 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str, count));
569#if defined(__xtd__cpp_lib_char8_t)
573 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
574 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str, count));
580 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
581 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str, count));
589 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
590 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str, count));
597 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
598 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str, count));
605 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
606 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str, count));
608#if defined(__xtd__cpp_lib_char8_t)
614 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
615 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str, count));
623 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
624 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str, count));
629 basic_string(
const std::basic_string<char>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str)) {};
632 basic_string(
const std::basic_string<xtd::char16>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str)) {};
635 basic_string(
const std::basic_string<xtd::char32>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str)) {};
636#if defined(__xtd__cpp_lib_char8_t)
639 basic_string(
const std::basic_string<xtd::char8>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str)) {};
643 basic_string(
const std::basic_string<xtd::wchar>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str)) {};
648 basic_string(
const std::basic_string<char>& str,
const allocator_type& allocator) noexcept : chars_(__xtd_convert_to_string<value_type>(str), allocator) {}
652 basic_string(
const std::basic_string<xtd::char16>& str,
const allocator_type& allocator) noexcept : chars_(__xtd_convert_to_string<value_type>(str), allocator) {}
656 basic_string(
const std::basic_string<xtd::char32>& str,
const allocator_type& allocator) noexcept : chars_(__xtd_convert_to_string<value_type>(str), allocator) {}
657#if defined(__xtd__cpp_lib_char8_t)
661 basic_string(
const std::basic_string<xtd::char8>& str,
const allocator_type& allocator) noexcept : chars_(__xtd_convert_to_string<value_type>(str), allocator) {}
666 basic_string(
const std::basic_string<xtd::wchar>& str,
const allocator_type& allocator) noexcept : chars_(__xtd_convert_to_string<value_type>(str), allocator) {}
671 template<
typename input_iterator_t>
672 basic_string(input_iterator_t first, input_iterator_t last) : chars_(first, last) {}
677 template<
typename input_iterator_t>
683 template<
typename string_view_like_t>
684 explicit constexpr basic_string(
const string_view_like_t& string_view) : chars_(string_view) {}
688 template<
typename string_view_like_t>
695 template<
typename string_view_like_t>
702 template<
typename string_view_like_t>
714#if defined(__xtd__cpp_lib_char8_t)
735#if defined(__xtd__cpp_lib_char8_t)
804 bool empty() const noexcept {
return chars_.empty();}
1010 if (!
dynamic_cast<const basic_string*
>(&value)) __throw_basic_string_argument_exception(__FILE__, __LINE__, __func__);
1047 if (ignore_case)
return to_upper().chars_ == value.to_upper().chars_;
1048 return chars_ == value.chars_;
1078 return rfind(value) + value.size() ==
size();
1315 explicit basic_string_enumerator(
const basic_string& chars) : chars_(chars) {}
1317 const value_type& current()
const override {
return chars_[index_];}
1319 bool move_next()
override {
return ++index_ < chars_.size();}
1321 void reset()
override {index_ = basic_string::npos;}
1327 return {new_ptr<basic_string_enumerator>(*
this)};
1346 if (start_index >
size() || start_index + count >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1347 auto result =
find(value, start_index);
1348 return result > start_index + count ?
npos : result;
1366 if (start_index >
size() || start_index + count >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1367 auto result =
find(value, start_index);
1368 return result > start_index + count ?
npos : result;
1401 if (start_index >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1402 auto result = *
this;
1403 result.chars_.insert(start_index, value);
1410 [[deprecated(
"Replaced by xtd::basic_string::is_empty(const xtd::basic_string&) - Will be removed in version 0.4.0")]]
1430 if (start_index >
size() || start_index + count >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1431 auto result =
rfind(value, start_index + count - value.
size());
1432 return result < start_index ?
npos : result;
1452 if (start_index >
size() || start_index + count >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1453 auto result =
rfind(value, start_index + count - 1);
1454 return result < start_index ?
npos : result;
1522 std::wstringstream ss;
1523 ss << std::quoted(__xtd_convert_to_string<xtd::wchar>(chars_),
static_cast<xtd::wchar>(delimiter),
static_cast<xtd::wchar>(
escape));
1536 if (start_index >
size() || start_index + count >
size()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
1537 auto result = *
this;
1538 result.chars_.erase(start_index, count);
1553 auto result = *
this;
1554 auto old_size = old_string.
size();
1555 auto new_size = new_string.size();
1558 index = result.find(old_string, index);
1559 if (index ==
npos)
break;
1560 if (old_size == new_size) result.chars_.replace(index, old_size, new_string);
1562 result.chars_.erase(index, old_string.size());
1563 result.chars_.insert(index, new_string);
1565 index += new_string.size();
1719 return find(value) == 0;
1738 return find(value) == 0;
1752 if (pos >
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1753 return chars_.substr(pos);
1762 if (pos >
size() || pos + count >
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1763 return chars_.substr(pos, count);
1772 if (start_index >
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1773 return substr(start_index);
1781 if (start_index >
size() || start_index +
length >
size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1811 std::for_each(chars_.begin(), chars_.end(), [&](
auto c) {result += static_cast<value_type>(std::tolower(c));});
1833#if defined(__xtd__cpp_lib_char8_t)
1843 std::for_each(chars_.begin(), chars_.end(), [&](
auto c) {result += static_cast<value_type>(std::toupper(c));});
1907 template<
typename object_t>
1908 [[deprecated(
"Replaced by typeof_<object_t>().name() - Will be removed in version 0.4.0")]]
1914 template<
typename object_t>
1915 [[deprecated(
"Replaced by typeof_(object).name() - Will be removed in version 0.4.0")]]
1921 [[deprecated(
"Replaced by typeof_(info).name() - Will be removed in version 0.4.0")]]
1982 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);}
2011 template<
typename object_a_t,
typename object_b_t,
typename object_c_t,
typename object_d_t>
2012 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);}
2024 template<
typename object_a_t,
typename object_b_t,
typename object_c_t>
2025 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);}
2035 template<
typename object_a_t,
typename object_b_t>
2043 template<
typename other_
char_t>
2045 static basic_string concat(
const std::initializer_list<basic_string>& values)
noexcept {
2047 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
2050 static basic_string concat(
const std::initializer_list<const_pointer>& values)
noexcept {
2052 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
2055 template<
typename other_
char_t>
2056 static basic_string concat(
const std::initializer_list<const other_char_t*>& values)
noexcept {
2058 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
2065 template<
typename object_t>
2068 template<
typename object_t>
2071 for (
const auto& arg : args)
2072 result +=
format(
"{}", arg);
2079 template<
typename value_t>
2081 return format(
"{}", value);
2117 template<
typename char_a_t,
typename char_b_t>
2133 template<
typename char_a_t,
typename char_b_t>
2142 template<
typename ...args_t>
2149 template<
typename object_t>
2150 [[deprecated(
"Replaced by typeof_<object_t>().full_name() - Will be removed in version 0.4.0")]]
2156 template<
typename object_t>
2157 [[deprecated(
"Replaced by typeof_(object).full_name() - Will be removed in version 0.4.0")]]
2163 [[deprecated(
"Replaced by typeof_(info).full_name() - Will be removed in version 0.4.0")]]
2177 template<
typename collection_t>
2186 template<
typename collection_t>
2196 template<
typename collection_t>
2198 if (index > values.size() || index + count > values.size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
2201 for (
const auto& item : values) {
2204 result +=
format(
"{}", item);
2206 if (++
i >= index + count)
break;
2211 template<
typename value_t>
2213 template<
typename value_t>
2215 template<
typename value_t>
2222 template<
typename value_t>
2224 return xtd::parse<value_t>(__xtd_convert_to_string<char>(str.
chars()));
2286 template<
typename ... args_t>
2293 template<
typename value_t>
2296 value = parse<value_t>(str);
2312 if (index >=
length()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
2313 return chars_[index];
2318 virtual operator const base_type&()
const noexcept {
return chars_;}
2324 if constexpr(std::is_same<char_t, char>::value) chars_ = str.chars_;
2325 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2332 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = str.chars_;
2333 else chars_ = chars_ = __xtd_convert_to_string<value_type>(str.chars());
2340 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = str.chars_;
2341 else chars_ = chars_ = __xtd_convert_to_string<value_type>(str.chars());
2344#if defined(__xtd__cpp_lib_char8_t)
2349 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = str.chars_;
2350 else chars_ = chars_ = __xtd_convert_to_string<value_type>(str.chars());
2358 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = str.chars_;
2359 else chars_ = chars_ = __xtd_convert_to_string<value_type>(str.chars());
2367 if constexpr(std::is_same<char_t, char>::value) chars_ = std::move(str.chars_);
2368 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2375 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = std::move(str.chars_);
2376 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2383 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = std::move(str.chars_);
2384 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2387#if defined(__xtd__cpp_lib_char8_t)
2392 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = std::move(str.chars_);
2393 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2401 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = std::move(str.chars_);
2402 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
2410 if constexpr(std::is_same<char_t, char>::value) chars_ = str;
2411 else chars_ = __xtd_convert_to_string<value_type>(str);
2418 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = str;
2419 else chars_ = __xtd_convert_to_string<value_type>(str);
2426 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = str;
2427 else chars_ = __xtd_convert_to_string<value_type>(str);
2430#if defined(__xtd__cpp_lib_char8_t)
2435 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = str;
2436 else chars_ = __xtd_convert_to_string<value_type>(str);
2444 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = str;
2445 else chars_ = __xtd_convert_to_string<value_type>(str);
2453 if constexpr(std::is_same<char_t, char>::value) chars_ = std::move(str);
2454 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2461 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = std::move(str);
2462 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2469 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = std::move(str);
2470 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2473#if defined(__xtd__cpp_lib_char8_t)
2478 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = std::move(str);
2479 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2487 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = std::move(str);
2488 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2497 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
2498 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str));
2506 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
2507 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str));
2515 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
2516 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str));
2519#if defined(__xtd__cpp_lib_char8_t)
2525 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
2526 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str));
2535 if (str ==
null) __throw_basic_string_null_pointer_exception(__FILE__, __LINE__, __func__);
2536 chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
2561#if defined(__xtd__cpp_lib_char8_t)
2599#if defined(__xtd__cpp_lib_char8_t)
2620 chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2627 chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2634 chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2637#if defined(__xtd__cpp_lib_char8_t)
2642 chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2650 chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2658 chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2665 chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2672 chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2675#if defined(__xtd__cpp_lib_char8_t)
2680 chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2688 chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2696 chars_ += __xtd_convert_to_string<value_type>(str);
2703 chars_ += __xtd_convert_to_string<value_type>(str);
2710 chars_ += __xtd_convert_to_string<value_type>(str);
2713#if defined(__xtd__cpp_lib_char8_t)
2718 chars_ += __xtd_convert_to_string<value_type>(str);
2726 chars_ += __xtd_convert_to_string<value_type>(str);
2750#if defined(__xtd__cpp_lib_char8_t)
2787#if defined(__xtd__cpp_lib_char8_t)
2831#if defined(__xtd__cpp_lib_char8_t)
2857 auto result = std::move(lhs);
2858 result += std::move(rhs);
2866 auto result = std::move(lhs);
2867 result += std::move(rhs);
2875 auto result = std::move(lhs);
2876 result += std::move(rhs);
2879#if defined(__xtd__cpp_lib_char8_t)
2885 auto result = std::move(lhs);
2886 result += std::move(rhs);
2895 auto result = std::move(lhs);
2896 result += std::move(rhs);
2905 auto result = std::move(lhs);
2914 auto result = std::move(lhs);
2923 auto result = std::move(lhs);
2927#if defined(__xtd__cpp_lib_char8_t)
2933 auto result = std::move(lhs);
2943 auto result = std::move(lhs);
2954 result += std::move(rhs);
2963 result += std::move(rhs);
2972 result += std::move(rhs);
2975#if defined(__xtd__cpp_lib_char8_t)
2982 result += std::move(rhs);
2992 result += std::move(rhs);
3023#if defined(__xtd__cpp_lib_char8_t)
3050 result += __xtd_convert_to_string<char>(rhs.
chars());
3059 result += __xtd_convert_to_string<xtd::char16>(rhs.
chars());
3068 result += __xtd_convert_to_string<xtd::char32>(rhs.
chars());
3071#if defined(__xtd__cpp_lib_char8_t)
3078 result += __xtd_convert_to_string<xtd::char8>(rhs.
chars());
3088 result += __xtd_convert_to_string<xtd::wchar>(rhs.
chars());
3119#if defined(__xtd__cpp_lib_char8_t)
3145 auto result = std::move(lhs);
3154 auto result = std::move(lhs);
3163 auto result = std::move(lhs);
3167#if defined(__xtd__cpp_lib_char8_t)
3173 auto result = std::move(lhs);
3183 auto result = std::move(lhs);
3215#if defined(__xtd__cpp_lib_char8_t)
3242 result += std::move(rhs);
3251 result += std::move(rhs);
3260 result += std::move(rhs);
3264#if defined(__xtd__cpp_lib_char8_t)
3271 result += std::move(rhs);
3281 result += std::move(rhs);
3312#if defined(__xtd__cpp_lib_char8_t)
3338 auto result = std::move(lhs);
3347 auto result = std::move(lhs);
3356 auto result = std::move(lhs);
3360#if defined(__xtd__cpp_lib_char8_t)
3366 auto result = std::move(lhs);
3376 auto result = std::move(lhs);
3408#if defined(__xtd__cpp_lib_char8_t)
3435 result += std::move(rhs);
3444 result += std::move(rhs);
3453 result += std::move(rhs);
3456#if defined(__xtd__cpp_lib_char8_t)
3463 result += std::move(rhs);
3473 result += std::move(rhs);
3486 friend std::basic_ostream<char>&
operator <<(std::basic_ostream<char>& stream,
const basic_string& str) {
return stream << __xtd_convert_to_string<char>(str.
chars());}
3504 auto s = std::basic_string<char> {};
3518 auto s = std::basic_string<xtd::wchar> {};
3529#if defined(__xtd__cpp_lib_char8_t)
3534 static const
xtd::array<value_type> default_split_separators;
3535 static const
xtd::array<value_type> default_trim_chars;
3537 template<typename arg_t>
3538 static auto convert_param(arg_t&& arg) noexcept {
3539 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();
3540 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();
3541 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();
3542#if defined(__xtd__cpp_lib_char8_t)
3543 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();
3545 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();
3546 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();
3547 else return std::forward<arg_t>(arg);
3551 auto length = full_name.last_index_of(
"<");
3553 if (full_name.last_index_of(
"::", 0,
length) ==
npos)
return full_name;
3554 return full_name.substring(full_name.last_index_of(
"::", 0,
length) + 2);
3557 typename base_type::iterator to_base_type_iterator(
iterator value)
const noexcept {
3558 if (value ==
begin())
return chars_.begin();
3559 if (value ==
end())
return chars_.end();
3560 return chars_.begin() + (value -
begin());
3563 iterator to_iterator(
typename base_type::iterator value)
const noexcept {
3564 if (value == chars_.begin())
return begin();
3565 if (value == chars_.end())
return end();
3566 return begin() + (value - chars_.begin());
3573#define __XTD_BASIC_STRING_INTERNAL__
3574#include "basic_string.hpp"
3575#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:148
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:572
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:295
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:2036
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:1353
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:1955
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:1809
static value_t parse(const basic_string &str)
Converts a basic_string into a value_t type.
Definition basic_string.h:2223
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:1483
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:185
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:400
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:210
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:1076
static basic_string class_name(const object_t &object)
Gets the class name of the specified object.
Definition basic_string.h:1916
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:1274
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:530
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:684
allocator_type get_allocator() const
Returns the allocator associated with the string.
Definition basic_string.h:1302
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:1365
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:449
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:596
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:1358
basic_string trim() const noexcept
Removes all leading and trailing occurrences of white-space characters from the specified xtd::basic_...
Definition basic_string.h:1855
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:826
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:414
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:730
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:538
basic_string(const xtd::char32 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.h:494
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:1128
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:1780
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:435
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:523
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:1254
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:1059
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:726
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:553
enumerator_type get_enumerator() const noexcept override
Returns an enumerator that iterates through a collection.
Definition basic_string.h:1312
static basic_string demangle(const basic_string &name)
Gets demangled basic_string of name,.
Definition basic_string.h:2104
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:473
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:678
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:419
int32 compare(size_type pos1, size_type count1, const basic_string &str) const
Compares two character sequences.
Definition basic_string.h:885
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:1587
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:1298
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:1593
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:1573
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:152
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:478
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:305
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:2294
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:672
virtual const base_type & get_base_type() const noexcept
Returns the underlying base type.
Definition basic_string.h:1306
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:1199
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:1422
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:1236
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:179
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:2164
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:3503
basic_string(std::initializer_list< xtd::wchar > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.h:721
int32 compare(size_type pos1, size_type count1, const_pointer s) const
Compares two character sequences.
Definition basic_string.h:975
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:1243
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:1172
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:2012
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:1725
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:468
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:1030
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:1134
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:2126
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:1400
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:145
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:380
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:1155
basic_string to_upper() const noexcept
Returns a copy of the current xtd::basic_string converted to uppercase.
Definition basic_string.h:1841
int32 compare(size_type pos1, size_type count1, const_pointer s, size_type count2) const
Compares two character sequences.
Definition basic_string.h:998
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:629
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:783
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:1429
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:652
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:2197
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:1771
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:440
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:1204
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:1761
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:1021
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:1510
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:1996
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:713
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:2187
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:1104
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:1849
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:632
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:579
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:174
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:1530
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:219
const_iterator begin() const override
Returns an iterator to the first character of the string.
Definition basic_string.h:757
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:3486
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:315
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:1292
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:808
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:703
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:734
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:346
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:1535
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:1437
static basic_string class_name()
Gets the class name of the object_t.
Definition basic_string.h:1909
static basic_string class_name(const std::type_info &info)
Gets the class name of the specified object.
Definition basic_string.h:1922
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:787
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:424
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:1280
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:156
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:2111
bool is_empty() const noexcept
Indicates whether this basic_string is an empty basic_string ("").
Definition basic_string.h:1411
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:648
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:1116
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:1611
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:1944
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:1933
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:201
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:2018
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:286
basic_string(const char *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.h:482
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:238
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:822
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:1515
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:1009
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:193
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:1504
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:458
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:613
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:934
basic_string(std::initializer_list< char > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.h:707
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:2134
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:2025
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:229
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:1552
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:165
xtd::size get_hash_code() const noexcept override
Returns the hash code for this basic_string.
Definition basic_string.h:1310
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:1717
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:1026
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:1260
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:1178
bool ends_with(value_type value) const noexcept
Determines whether the end of this basic_string matches the specified character.
Definition basic_string.h:1054
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:267
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:1605
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:2004
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:2178
const_reverse_iterator crend() const
Returns a reverse iterator to the character following the last character of the string....
Definition basic_string.h:791
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:463
basic_string(const xtd::wchar *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.h:508
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:1451
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:516
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:2323
const_reverse_iterator crbegin() const
Returns a reverse iterator to the first character of the string.
Definition basic_string.h:779
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:1142
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:257
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:1345
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:247
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:800
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:2030
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:1084
basic_string trim_end() const noexcept
Removes all trailing occurrences of white-space characters from the specified xtd::basic_string.
Definition basic_string.h:1871
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:2118
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:1968
const_reverse_iterator rend() const
Returns a reverse iterator to the character following the last character of the string....
Definition basic_string.h:830
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:1333
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:1210
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:444
int32 compare(const_pointer s) const
Compares two character sequences.
Definition basic_string.h:953
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:1035
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:1160
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:1192
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:834
const_reference at(size_type pos) const
Returns a reference to the character at specified location pos.
Definition basic_string.h:843
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:1186
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:277
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:1751
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:1546
size_type length() const noexcept
Gets the number of characters in the current xtd::basic_string object.
Definition basic_string.h:818
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:1071
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:404
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:430
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:656
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:588
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:2169
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:696
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:391
basic_string(const xtd::char16 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.h:488
basic_string & operator+=(const basic_string< char > &str)
Addition assignment operator. Appends additional characters to the string.
Definition basic_string.h:2619
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:559
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:1046
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:1497
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:1222
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:2151
basic_string(std::initializer_list< xtd::char16 > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.h:710
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:395
int32 compare(size_type pos1, size_type count1, const basic_string &str, size_type pos2) const
Compares two character sequences.
Definition basic_string.h:909
static basic_string concat(value_t value) noexcept
Creates the basic_string representation of a specified object.
Definition basic_string.h:2080
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:717
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:813
basic_string trim_start() const noexcept
Removes all leading occurrences of white-space characters from the specified xtd::basic_string.
Definition basic_string.h:1887
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:1066
xtd::string to_string() const noexcept override
Converts the value of this instance to a xtd::basic_string <char>.
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:1148
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:169
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:2158
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:1416
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:1490
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:604
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:1040
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:1711
const_iterator cbegin() const override
Returns an iterator to the first character of the string.
Definition basic_string.h:775
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:386
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:1248
basic_string(const xtd::char8 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.h:501
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:739
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:1579
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:1982
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:368
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:1287
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:1836
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:453
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:357
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:1122
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:1216
int32 compare(const basic_string &str) const
Compares two character sequences.
Definition basic_string.h:863
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:767
bool empty() const noexcept
Checks if the string has no characters, i.e. whether begin() == end().
Definition basic_string.h:804
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:622
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:744
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:643
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:546
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:1230
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:661
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:689
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:1745
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:1266
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:1090
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:1338
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:635
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:2808
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:1166
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:565
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:639
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:326
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:1731
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:336
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:666
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:1521
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:161
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:1827
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:409
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:1831
const_reference operator[](xtd::size index) const
Returns a reference to the character at specified location index.
Definition basic_string.h:2311
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:1443
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:1736
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:1098
size_type capacity() const noexcept
Returns the number of characters that the string has currently allocated space for.
Definition basic_string.h:771
const_reference back() const
Returns reference to the last character in the string.
Definition basic_string.h:753
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:1111
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:1600
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
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
std::nullptr_t null
Represents a null pointer value.
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 xtd fundamental types.
Contains unused_ keyword.