xtd 0.2.0
Loading...
Searching...
No Matches
basic_string.h
Go to the documentation of this file.
1
4#pragma once
6#define __XTD_CORE_INTERNAL__
11#undef __XTD_CORE_INTERNAL__
12#define __XTD_STD_INTERNAL__
14#undef __XTD_STD_INTERNAL__
17#include "hash_code.h"
18#include "icomparable.h"
19#include "iequatable.h"
20#include "null.h"
21#include "string_comparison.h"
23#include "types.h"
24#include "object.h"
25#include "parse.h"
26#include "to_string.h"
27#include "types.h"
28#include "unused.h"
29#include <cctype>
30#if defined(__xtd__cpp_lib_format)
31#include <format>
32#endif
33#include <iomanip>
34#include <ostream>
35#include <sstream>
36#include <string>
37
39template<typename ...args_t>
40void __basic_string_extract_format_arg(xtd::basic_string<char>& fmt, xtd::array<__format_information<char>>& formats, args_t&&... args);
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);
57
59namespace xtd {
78 template<typename char_t, typename traits_t, typename allocator_t>
79 class basic_string : public object, public xtd::icomparable<basic_string<char_t, traits_t, allocator_t>>, public xtd::iequatable<basic_string<char_t, traits_t, allocator_t>>, public xtd::collections::generic::ienumerable<char_t> {
80 public:
82
86 using base_type = std::basic_string<char_t, traits_t, allocator_t>;
88 using traits_type = typename base_type::traits_type;
90 using value_type = typename base_type::value_type;
92 using allocator_type = typename base_type::allocator_type;
94 using size_type = typename base_type::size_type;
96 using difference_type = typename base_type::difference_type;
98 using reference = typename base_type::reference;
100 using const_reference = typename base_type::const_reference;
102 using pointer = typename base_type::pointer;
104 using const_pointer = typename base_type::const_pointer;
112 using reverse_iterator = typename base_type::reverse_iterator;
114 using const_reverse_iterator = typename base_type::const_reverse_iterator;
118
120
125
127 inline static constexpr size_type npos = base_type::npos;
129
131
134 basic_string() = default;
137 explicit basic_string(const allocator_type& allocator) noexcept;
138
141 basic_string(const basic_string<char>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str.chars_)) {}
142
145 basic_string(const basic_string<xtd::char16>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str.chars_)) {}
148 basic_string(const basic_string<xtd::char32>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str.chars_)) {}
149#if defined(__xtd__cpp_lib_char8_t)
152 basic_string(const basic_string<xtd::char8>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str.chars_)) {}
153#endif
156 basic_string(const basic_string<xtd::wchar>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str.chars_)) {}
157
161 basic_string(const basic_string<char>& str, const allocator_type& allocator) noexcept : chars_(__xtd_convert_to_string<value_type>(str.chars_), allocator) {}
165 basic_string(const basic_string<xtd::char16>& str, const allocator_type& allocator) noexcept : chars_(__xtd_convert_to_string<value_type>(str.chars_), allocator) {}
169 basic_string(const basic_string<xtd::char32>& str, const allocator_type& allocator) noexcept : chars_(__xtd_convert_to_string<value_type>(str.chars_), allocator) {}
170#if defined(__xtd__cpp_lib_char8_t)
174 basic_string(const basic_string<xtd::char8>& str, const allocator_type& allocator) noexcept : chars_(__xtd_convert_to_string<value_type>(str.chars_), allocator) {}
175#endif
179 basic_string(const basic_string<xtd::wchar>& str, const allocator_type& allocator) noexcept : chars_(__xtd_convert_to_string<value_type>(str.chars_), allocator) {}
180
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)));
188 }
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)));
196 }
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)));
204 }
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)));
213 }
214#endif
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)));
222 }
223
229 basic_string(const basic_string<char>& str, xtd::size index, const allocator_type& allocator) {
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);
232 }
238 basic_string(const basic_string<xtd::char16>& str, xtd::size index, const allocator_type& 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);
241 }
247 basic_string(const basic_string<xtd::char32>& str, xtd::size index, const allocator_type& 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);
250 }
251#if defined(__xtd__cpp_lib_char8_t)
257 basic_string(const basic_string<xtd::char8>& str, xtd::size index, const allocator_type& allocator) {
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);
260 }
261#endif
267 basic_string(const basic_string<xtd::wchar>& str, xtd::size index, const allocator_type& 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);
270 }
271
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)));
280 }
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)));
289 }
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)));
298 }
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)));
308 }
309#endif
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)));
318 }
319
326 basic_string(const basic_string<char>& str, xtd::size index, xtd::size count, const allocator_type& allocator) {
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);
329 }
336 basic_string(const basic_string<xtd::char16>& str, xtd::size index, xtd::size count, const allocator_type& 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);
339 }
346 basic_string(const basic_string<xtd::char32>& str, xtd::size index, xtd::size count, const allocator_type& 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);
349 }
350#if defined(__xtd__cpp_lib_char8_t)
357 basic_string(const basic_string<xtd::char8>& str, xtd::size index, xtd::size count, const allocator_type& allocator) {
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);
360 }
361#endif
368 basic_string(const basic_string<xtd::wchar>& str, xtd::size index, xtd::size count, const allocator_type& 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);
371 }
372
376
380 basic_string(basic_string&& str, const allocator_type& allocator) noexcept : chars_(std::move(str.chars_)) {}
381
386 basic_string(xtd::size count, char character) : basic_string(std::basic_string<char>(count, character)) {}
391 basic_string(xtd::size count, char character, const allocator_type& allocator) : basic_string(std::basic_string<char>(count, character), allocator) {}
395 basic_string(xtd::size count, xtd::char16 character) : basic_string(std::basic_string<xtd::char16>(count, character)) {}
400 basic_string(xtd::size count, xtd::char16 character, const allocator_type& allocator) : basic_string(std::basic_string<xtd::char16>(count, character), allocator) {}
404 basic_string(xtd::size count, xtd::char32 character) : basic_string(std::basic_string<xtd::char32>(count, character)) {}
409 basic_string(xtd::size count, xtd::char32 character, const allocator_type& allocator) : basic_string(std::basic_string<xtd::char32>(count, character), allocator) {}
410#if defined(__xtd__cpp_lib_char8_t)
414 basic_string(xtd::size count, xtd::char8 character) : basic_string(std::basic_string<xtd::char8>(count, character)) {}
419 basic_string(xtd::size count, xtd::char8 character, const allocator_type& allocator) : basic_string(std::basic_string<xtd::char8>(count, character), allocator) {}
420#endif
424 basic_string(xtd::size count, xtd::wchar character) : basic_string(std::basic_string<xtd::wchar>(count, character)) {}
430 basic_string(xtd::size count, xtd::wchar character, const allocator_type& allocator) : basic_string(std::basic_string<xtd::wchar>(count, character), allocator) {}
431
435 basic_string(char character, xtd::size count) : basic_string(std::basic_string<char>(count, character)) {}
440 basic_string(char character, xtd::size count, const allocator_type& allocator) : basic_string(std::basic_string<char>(count, character), allocator) {}
444 basic_string(xtd::char16 character, xtd::size count) : basic_string(std::basic_string<xtd::char16>(count, character)) {}
449 basic_string(xtd::char16 character, xtd::size count, const allocator_type& allocator) : basic_string(std::basic_string<xtd::char16>(count, character), allocator) {}
453 basic_string(xtd::char32 character, xtd::size count) : basic_string(std::basic_string<xtd::char32>(count, character)) {}
458 basic_string(xtd::char32 character, xtd::size count, const allocator_type& allocator) : basic_string(std::basic_string<xtd::char32>(count, character), allocator) {}
459#if defined(__xtd__cpp_lib_char8_t)
463 basic_string(xtd::char8 character, xtd::size count) : basic_string(std::basic_string<xtd::char8>(count, character)) {}
468 basic_string(xtd::char8 character, xtd::size count, const allocator_type& allocator) : basic_string(std::basic_string<xtd::char8>(count, character), allocator) {}
469#endif
473 basic_string(xtd::wchar character, xtd::size count) : basic_string(std::basic_string<xtd::wchar>(count, character)) {}
478 basic_string(xtd::wchar character, xtd::size count, const allocator_type& allocator) : basic_string(std::basic_string<xtd::wchar>(count, character), allocator) {}
479
482 basic_string(const char* str) { // Can't be explicit by design.
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));
485 }
488 basic_string(const xtd::char16* str) { // Can't be explicit by design.
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));
491 }
494 basic_string(const xtd::char32* str) { // Can't be explicit by design.
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));
497 }
498#if defined(__xtd__cpp_lib_char8_t)
501 basic_string(const xtd::char8* str) { // Can't be explicit by design.
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));
504 }
505#endif
508 basic_string(const xtd::wchar* str) { // Can't be explicit by design.
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));
511 }
512
516 basic_string(const char* str, const allocator_type& allocator) : chars_(allocator) {
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));
519 }
523 basic_string(const xtd::char16* str, const allocator_type& allocator) : chars_(allocator) {
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));
526 }
530 basic_string(const xtd::char32* str, const allocator_type& allocator) : chars_(allocator) {
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));
533 }
534#if defined(__xtd__cpp_lib_char8_t)
538 basic_string(const xtd::char8* str, const allocator_type& allocator) : chars_(allocator) {
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));
541 }
542#endif
546 basic_string(const xtd::wchar* str, const allocator_type& allocator) : chars_(allocator) {
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));
549 }
550
553 basic_string(const char* str, xtd::size count) {
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));
556 }
559 basic_string(const xtd::char16* str, xtd::size 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));
562 }
565 basic_string(const xtd::char32* str, xtd::size 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));
568 }
569#if defined(__xtd__cpp_lib_char8_t)
572 basic_string(const xtd::char8* str, xtd::size count) {
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));
575 }
576#endif
579 basic_string(const xtd::wchar* str, xtd::size 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));
582 }
583
588 basic_string(const char* str, xtd::size count, const allocator_type& allocator) : chars_(allocator) {
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));
591 }
596 basic_string(const xtd::char16* str, xtd::size count, const allocator_type& allocator) : chars_(allocator) {
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));
599 }
604 basic_string(const xtd::char32* str, xtd::size count, const allocator_type& allocator) : chars_(allocator) {
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));
607 }
608#if defined(__xtd__cpp_lib_char8_t)
613 basic_string(const xtd::char8* str, xtd::size count, const allocator_type& allocator) : chars_(allocator) {
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));
616 }
617#endif
622 basic_string(const xtd::wchar* str, xtd::size count, const allocator_type& allocator) : chars_(allocator) {
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));
625 }
626
629 basic_string(const std::basic_string<char>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str)) {}; // Can't be explicit by design.
632 basic_string(const std::basic_string<xtd::char16>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str)) {}; // Can't be explicit by design.
635 basic_string(const std::basic_string<xtd::char32>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str)) {}; // Can't be explicit by design.
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)) {}; // Can't be explicit by design.
640#endif
643 basic_string(const std::basic_string<xtd::wchar>& str) noexcept : chars_(__xtd_convert_to_string<value_type>(str)) {}; // Can't be explicit by design.
644
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) {}
662#endif
666 basic_string(const std::basic_string<xtd::wchar>& str, const allocator_type& allocator) noexcept : chars_(__xtd_convert_to_string<value_type>(str), allocator) {}
667
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>
678 basic_string(input_iterator_t first, input_iterator_t last, const allocator_type& allocator) : chars_(first, last, allocator) {}
679
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>
689 explicit constexpr basic_string(const string_view_like_t& string_view, const allocator_type& allocator) : chars_(string_view, allocator) {}
695 template<typename string_view_like_t>
696 constexpr basic_string(const string_view_like_t& string_view, size_type index, size_type count) : chars_(string_view, index, count) {}
702 template<typename string_view_like_t>
703 constexpr basic_string(const string_view_like_t& string_view, size_type index, size_type count, const allocator_type& allocator) : chars_(string_view, index, count, allocator) {}
704
707 basic_string(std::initializer_list<char> il) : basic_string(std::basic_string<char>(il)) {}
710 basic_string(std::initializer_list<xtd::char16> il) : basic_string(std::basic_string<xtd::char16>(il)) {}
713 basic_string(std::initializer_list<xtd::char32> il) : basic_string(std::basic_string<xtd::char32>(il)) {}
714#if defined(__xtd__cpp_lib_char8_t)
717 basic_string(std::initializer_list<xtd::char8> il) : basic_string(std::basic_string<xtd::char8>(il)) {}
718#endif
721 basic_string(std::initializer_list<xtd::wchar> il) : basic_string(std::basic_string<xtd::wchar>(il)) {}
722
726 basic_string(std::initializer_list<char> il, const allocator_type& allocator) : basic_string(std::basic_string<char>(il), allocator) {}
730 basic_string(std::initializer_list<xtd::char16> il, const allocator_type& allocator) : basic_string(std::basic_string<xtd::char16>(il), allocator) {}
734 basic_string(std::initializer_list<xtd::char32> il, const allocator_type& allocator) : basic_string(std::basic_string<xtd::char32>(il), allocator) {}
735#if defined(__xtd__cpp_lib_char8_t)
739 basic_string(std::initializer_list<xtd::char8> il, const allocator_type& allocator) : basic_string(std::basic_string<xtd::char8>(il), allocator) {}
740#endif
744 basic_string(std::initializer_list<xtd::wchar> il, const allocator_type& allocator) : basic_string(std::basic_string<xtd::wchar>(il), allocator) {}
746
748
753 const_reference back() const {return operator[](size() - 1);}
754
758
767 const_pointer c_str() const noexcept {return chars_.c_str();}
768
771 size_type capacity() const noexcept {return chars_.capacity();}
772
776
779 const_reverse_iterator crbegin() const {return chars_.crbegin();}
780
783 const base_type& chars() const noexcept {return chars_;}
784
788
791 const_reverse_iterator crend() const {return chars_.crend();}
792
800 const_pointer data() const noexcept {return chars_.data();}
801
804 bool empty() const noexcept {return chars_.empty();}
805
809
813 const_reference front() const {return operator[](0);}
814
818 size_type length() const noexcept {return chars_.size();}
819
822 size_type max_size() const noexcept {return chars_.max_size();}
823
826 const_reverse_iterator rbegin() const {return chars_.crbegin();}
827
830 const_reverse_iterator rend() const {return chars_.crend();}
831
834 size_type size() const noexcept {return chars_.size();}
836
838
843 const_reference at(size_type pos) const {return operator [](pos);}
844
863 int32 compare(const basic_string& str) const {return chars_.compare(str);}
885 int32 compare(size_type pos1, size_type count1, const basic_string& str) const {return chars_.compare(pos1, count1, str);}
909 int32 compare(size_type pos1, size_type count1, const basic_string& str, size_type pos2) const {return chars_.compare(pos1, count1, str, pos2);}
934 int32 compare(size_type pos1, size_type count1, const basic_string& str, size_type pos2, size_type count2) const {return chars_.compare(pos1, count1, str, pos2, count2);}
953 int32 compare(const_pointer s) const {return chars_.compare(s);}
975 int32 compare(size_type pos1, size_type count1, const_pointer s) const {return chars_.compare(pos1, count1, s);}
998 int32 compare(size_type pos1, size_type count1, const_pointer s, size_type count2) const {return chars_.compare(pos1, count1, s, count2);}
999
1009 int32 compare_to(const object& value) const {
1010 if (!dynamic_cast<const basic_string*>(&value)) __throw_basic_string_argument_exception(__FILE__, __LINE__, __func__);
1011 return compare_to(static_cast<const basic_string&>(value));
1012 }
1021 int32 compare_to(const basic_string& value) const noexcept override {return chars_.compare(value.chars_);}
1022
1026 virtual bool contains(value_type value) const noexcept {return find(value) != npos;}
1030 virtual bool contains(const basic_string& value) const noexcept {return find(value) != npos;}
1031
1035 bool equals(const object& obj) const noexcept override {return dynamic_cast<const basic_string*>(&obj) && equals(static_cast<const basic_string&>(obj));}
1040 bool equals(const basic_string& value) const noexcept override {return equals(value, false);}
1046 bool equals(const basic_string& value, bool ignore_case) const noexcept {
1047 if (ignore_case) return to_upper().chars_ == value.to_upper().chars_;
1048 return chars_ == value.chars_;
1049 }
1050
1054 bool ends_with(value_type value) const noexcept {return ends_with(value, false);}
1059 bool ends_with(value_type value, bool ignore_case) const noexcept {
1060 if (ignore_case) return to_lower().rfind(static_cast<value_type>(tolower(value))) == size() - 1;
1061 return rfind(value) == size() - 1;
1062 }
1066 bool ends_with(const basic_string& value) const noexcept {return ends_with(value, xtd::string_comparison::ordinal);}
1071 bool ends_with(const basic_string& value, bool ignore_case) const noexcept {return ends_with(value, ignore_case ? xtd::string_comparison::ordinal_ignore_case : xtd::string_comparison::ordinal);}
1076 bool ends_with(const basic_string& value, xtd::string_comparison comparison_type) const noexcept {
1077 if (comparison_type == xtd::string_comparison::ordinal_ignore_case) return to_lower().rfind(value.to_lower()) + value.to_lower().size() == size();
1078 return rfind(value) + value.size() == size();
1079 }
1080
1084 size_type find(const basic_string& str) const {return chars_.find(str);}
1090 size_type find(const basic_string& str, size_type pos) const {return chars_.find(str, pos);}
1098 size_type find(const_pointer s, size_type pos, size_type count) const {return chars_.find(s, pos, count);}
1104 size_type find(const_pointer s) const {return chars_.find(s);}
1111 size_type find(const_pointer s, size_type pos) const {return chars_.find(s, pos);}
1116 size_type find(value_type ch) const {return chars_.find(ch);}
1122 size_type find(value_type ch, size_type pos) const {return chars_.find(ch, pos);}
1123
1128 size_type find_first_of(const basic_string& str) const {return chars_.find_first_of(str);}
1134 size_type find_first_of(const basic_string& str, size_type pos) const {return chars_.find_first_of(str, pos);}
1142 size_type find_first_of(const_pointer s, size_type pos, size_type count) const {return chars_.find_first_of(s, pos, count);}
1148 size_type find_first_of(const_pointer s) const {return chars_.find_first_of(s);}
1155 size_type find_first_of(const_pointer s, size_type pos) const {return chars_.find_first_of(s, pos);}
1160 size_type find_first_of(char_t ch) const {return chars_.find_first_of(ch);}
1166 size_type find_first_of(char_t ch, size_type pos) const {return chars_.find_first_of(ch, pos);}
1167
1172 size_type find_first_not_of(const basic_string& str) const {return chars_.find_first_not_of(str);}
1178 size_type find_first_not_of(const basic_string& str, size_type pos) const {return chars_.find_first_not_of(str, pos);}
1186 size_type find_first_not_of(const_pointer s, size_type pos, size_type count) const {return chars_.find_first_not_of(s, pos, count);}
1192 size_type find_first_not_of(const_pointer s) const {return chars_.find_first_not_of(s);}
1199 size_type find_first_not_of(const_pointer s, size_type pos) const {return chars_.find_first_not_of(s, pos);}
1204 size_type find_first_not_of(char_t ch) const {return chars_.find_first_not_of(ch);}
1210 size_type find_first_not_of(char_t ch, size_type pos) const {return chars_.find_first_not_of(ch, pos);}
1211
1216 size_type find_last_of(const basic_string& str) const {return chars_.find_last_of(str);}
1222 size_type find_last_of(const basic_string& str, size_type pos) const {return chars_.find_last_of(str, pos);}
1230 size_type find_last_of(const_pointer s, size_type pos, size_type count) const {return chars_.find_last_of(s, pos, count);}
1236 size_type find_last_of(const_pointer s) const {return chars_.find_last_of(s);}
1243 size_type find_last_of(const_pointer s, size_type pos) const {return chars_.find_last_of(s, pos);}
1248 size_type find_last_of(char_t ch) const {return chars_.find_last_of(ch);}
1254 size_type find_last_of(char_t ch, size_type pos) const {return chars_.find_last_of(ch, pos);}
1255
1260 size_type find_last_not_of(const basic_string& str) const {return chars_.find_last_not_of(str);}
1266 size_type find_last_not_of(const basic_string& str, size_type pos) const {return chars_.find_last_not_of(str, pos);}
1274 size_type find_last_not_of(const_pointer s, size_type pos, size_type count) const {return chars_.find_last_not_of(s, pos, count);}
1280 size_type find_last_not_of(const_pointer s) const {return chars_.find_last_not_of(s);}
1287 size_type find_last_not_of(const_pointer s, size_type pos) const {return chars_.find_last_not_of(s, pos);}
1292 size_type find_last_not_of(char_t ch) const {return chars_.find_last_not_of(ch);}
1298 size_type find_last_not_of(char_t ch, size_type pos) const {return chars_.find_last_not_of(ch, pos);}
1299
1302 allocator_type get_allocator() const {return chars_.get_allocator();}
1303
1306 virtual const base_type& get_base_type() const noexcept {return chars_;}
1307
1310 xtd::size get_hash_code() const noexcept override {return xtd::hash_code::combine(chars_);}
1311
1312 enumerator_type get_enumerator() const noexcept override {
1313 class basic_string_enumerator : public xtd::collections::generic::ienumerator<value_type> {
1314 public:
1315 explicit basic_string_enumerator(const basic_string& chars) : chars_(chars) {}
1316
1317 const value_type& current() const override {return chars_[index_];}
1318
1319 bool move_next() override {return ++index_ < chars_.size();}
1320
1321 void reset() override {index_ = basic_string::npos;}
1322
1323 protected:
1324 const basic_string& chars_;
1325 xtd::size index_ = basic_string::npos;
1326 };
1327 return {new_ptr<basic_string_enumerator>(*this)};
1328 }
1329
1333 xtd::size index_of(const basic_string& value) const noexcept {return index_of(value, 0, size());}
1338 xtd::size index_of(const basic_string& value, xtd::size start_index) const {return index_of(value, start_index, size() - start_index);}
1345 xtd::size index_of(const basic_string& value, xtd::size start_index, xtd::size count) const {
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;
1349 }
1353 xtd::size index_of(value_type value) const noexcept {return index_of(value, 0, size());}
1358 xtd::size index_of(value_type value, xtd::size start_index) const {return index_of(value, start_index, size() - start_index);}
1365 xtd::size index_of(value_type value, xtd::size start_index, xtd::size count) const {
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;
1369 }
1370
1374 xtd::size index_of_any(const xtd::array<value_type>& values) const noexcept;
1380 xtd::size index_of_any(const xtd::array<value_type>& values, xtd::size start_index) const;
1387 xtd::size index_of_any(const xtd::array<value_type>& values, xtd::size start_index, xtd::size count) const;
1389 xtd::size index_of_any(const std::initializer_list<value_type>& values) const noexcept;
1390 xtd::size index_of_any(const std::initializer_list<value_type>& values, xtd::size start_index) const;
1391 xtd::size index_of_any(const std::initializer_list<value_type>& values, xtd::size start_index, xtd::size count) const;
1393
1400 basic_string insert(xtd::size start_index, const basic_string& value) const {
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);
1404 return result;
1405 }
1406
1410 [[deprecated("Replaced by xtd::basic_string::is_empty(const xtd::basic_string&) - Will be removed in version 0.4.0")]]
1411 bool is_empty() const noexcept {return is_empty(*this);}
1412
1416 xtd::size last_index_of(const basic_string& value) const noexcept {return last_index_of(value, 0, size());}
1422 xtd::size last_index_of(const basic_string& value, xtd::size start_index) const {return last_index_of(value, start_index, size() - start_index);}
1429 xtd::size last_index_of(const basic_string& value, xtd::size start_index, xtd::size count) const {
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;
1433 }
1437 xtd::size last_index_of(value_type value) const noexcept {return last_index_of(value, 0, size());}
1443 xtd::size last_index_of(value_type value, xtd::size start_index) const {return last_index_of(value, start_index, size() - start_index);}
1451 xtd::size last_index_of(value_type value, xtd::size start_index, xtd::size count) const {
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;
1455 }
1456
1473 xtd::size last_index_of_any(const std::initializer_list<value_type>& values) const noexcept;
1474 xtd::size last_index_of_any(const std::initializer_list<value_type>& values, xtd::size start_index) const;
1475 xtd::size last_index_of_any(const std::initializer_list<value_type>& values, xtd::size start_index, xtd::size count) const;
1477
1483 basic_string pad_left(xtd::size total_width) const noexcept {return pad_left(total_width, ' ');}
1490 basic_string pad_left(xtd::size total_width, char32 padding_char) const noexcept {return total_width < size() ? *this : basic_string(total_width - size(), padding_char) + *this;}
1491
1497 basic_string pad_right(xtd::size total_width) const noexcept {return pad_right(total_width, ' ');}
1504 basic_string pad_right(xtd::size total_width, char32 padding_char) const noexcept {return total_width < size() ? *this : *this + basic_string(total_width - size(), padding_char);}
1505
1510 basic_string quoted() const {return quoted('"', '\\');}
1515 basic_string quoted(value_type delimiter) const {return quoted(delimiter, '\\');}
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));
1524 return ss.str();
1525 }
1526
1530 basic_string remove(xtd::size start_index) const {return remove(start_index, size() - start_index);}
1535 basic_string remove(xtd::size start_index, xtd::size count) const {
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);
1539 return result;
1540 }
1541
1546 basic_string replace(value_type old_char, value_type new_char) const noexcept {return replace(string(1, old_char), string(1, new_char));}
1552 basic_string replace(const basic_string& old_string, const basic_string& new_string) const noexcept {
1553 auto result = *this;
1554 auto old_size = old_string.size();
1555 auto new_size = new_string.size();
1556 auto index = xtd::size {0};
1557 while (true) {
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);
1561 else {
1562 result.chars_.erase(index, old_string.size());
1563 result.chars_.insert(index, new_string);
1564 }
1565 index += new_string.size();
1566 }
1567 return result;
1568 }
1569
1573 size_type rfind(const basic_string& str) const {return chars_.rfind(str);}
1579 size_type rfind(const basic_string& str, size_type pos) const {return chars_.rfind(str, pos);}
1587 size_type rfind(const_pointer s, size_type pos, size_type count) const {return chars_.rfind(s, pos, count);}
1593 size_type rfind(const_pointer s) const {return chars_.rfind(s);}
1600 size_type rfind(const_pointer s, size_type pos) const {return chars_.rfind(s, pos);}
1605 size_type rfind(value_type ch) const {return chars_.rfind(ch);}
1611 size_type rfind(value_type ch, size_type pos) const {return chars_.rfind(ch, pos);}
1612
1667 xtd::array<basic_string> split(const xtd::array<value_type>& separators) const noexcept;
1684 xtd::array<basic_string> split(const xtd::array<value_type>& separators, xtd::string_split_options options) const noexcept;
1693 xtd::array<basic_string> split(const xtd::array<value_type>& separators, xtd::size count) const noexcept;
1705 xtd::array<basic_string> split(const xtd::array<value_type>& separators, xtd::size count, xtd::string_split_options options) const noexcept;
1706
1711 bool starts_with(value_type value) const noexcept {return starts_with(value, false);}
1717 bool starts_with(value_type value, bool ignore_case) const noexcept {
1718 if (ignore_case) return to_lower().find(static_cast<value_type>(tolower(value))) == 0;
1719 return find(value) == 0;
1720 }
1725 bool starts_with(const basic_string& value) const noexcept {return starts_with(value, string_comparison::ordinal);}
1731 bool starts_with(const basic_string& value, bool ignore_case) const noexcept {return starts_with(value, ignore_case ? string_comparison::ordinal_ignore_case : string_comparison::ordinal);}
1736 bool starts_with(const basic_string& value, xtd::string_comparison comparison_type) const noexcept {
1737 if (comparison_type == xtd::string_comparison::ordinal_ignore_case) return to_lower().find(value.to_lower()) == 0;
1738 return find(value) == 0;
1739 }
1740
1745 basic_string substr() const {return chars_.substr();}
1752 if (pos > size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1753 return chars_.substr(pos);
1754 }
1762 if (pos > size() || pos + count > size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1763 return chars_.substr(pos, count);
1764 }
1765
1771 basic_string substring(xtd::size start_index) const {
1772 if (start_index > size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1773 return substr(start_index);
1774 }
1781 if (start_index > size() || start_index + length > size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
1782 return substr(start_index, length);
1783 }
1784
1791 xtd::array<value_type> to_array(xtd::size start_index) const;
1796 xtd::array<value_type> to_array(xtd::size start_index, xtd::size length) const;
1797
1800 xtd::array<value_type> to_char_array() const noexcept;
1806
1809 basic_string to_lower() const noexcept {
1810 auto result = basic_string::empty_string;
1811 std::for_each(chars_.begin(), chars_.end(), [&](auto c) {result += static_cast<value_type>(std::tolower(c));});
1812 return result;
1813 }
1814
1818 //xtd::string to_string() const noexcept override {return __xtd_convert_to_string<char>(chars_);}
1819 xtd::string to_string() const noexcept override;
1820
1823 basic_string to_title_case() const noexcept;
1824
1827 basic_string<xtd::char16> to_u16string() const noexcept {return __xtd_convert_to_string<xtd::char16>(chars_);}
1828
1831 basic_string<xtd::char32> to_u32string() const noexcept {return __xtd_convert_to_string<xtd::char32>(chars_);}
1832
1833#if defined(__xtd__cpp_lib_char8_t)
1836 basic_string<xtd::char8> to_u8string() const noexcept {return __xtd_convert_to_string<xtd::char8>(chars_);}
1837#endif
1838
1841 basic_string to_upper() const noexcept {
1842 auto result = basic_string::empty_string;
1843 std::for_each(chars_.begin(), chars_.end(), [&](auto c) {result += static_cast<value_type>(std::toupper(c));});
1844 return result;
1845 }
1846
1849 basic_string<xtd::wchar> to_wstring() const noexcept {return __xtd_convert_to_string<xtd::wchar>(chars_);}
1850
1855 basic_string trim() const noexcept {return trim(default_trim_chars);}
1860 basic_string trim(value_type trim_char) const noexcept;
1865 basic_string trim(const xtd::array<value_type>& trim_chars) const noexcept;
1866
1871 basic_string trim_end() const noexcept {return trim_end(default_trim_chars);}
1876 basic_string trim_end(value_type trim_char) const noexcept;
1881 basic_string trim_end(const xtd::array<value_type>& trim_chars) const noexcept;
1882
1887 basic_string trim_start() const noexcept {return trim_start(default_trim_chars);}
1892 basic_string trim_start(value_type trim_char) const noexcept;
1897 basic_string trim_start(const xtd::array<value_type>& trim_chars) const noexcept;
1899
1901
1907 template<typename object_t>
1908 [[deprecated("Replaced by typeof_<object_t>().name() - Will be removed in version 0.4.0")]]
1909 static basic_string class_name() {return get_class_name(full_class_name<object_t>());}
1914 template<typename object_t>
1915 [[deprecated("Replaced by typeof_(object).name() - Will be removed in version 0.4.0")]]
1916 static basic_string class_name(const object_t& object) {return get_class_name(full_class_name(object));}
1921 [[deprecated("Replaced by typeof_(info).name() - Will be removed in version 0.4.0")]]
1922 static basic_string class_name(const std::type_info& info) {return __xtd_get_class_name(info);}
1923
1933 static int32 compare(const basic_string& str_a, const basic_string& str_b) noexcept {return compare(str_a, str_b, false);}
1944 static int32 compare(const basic_string& str_a, const basic_string& str_b, bool ignore_case) noexcept {return compare(str_a, str_b, ignore_case ? xtd::string_comparison::ordinal_ignore_case : xtd::string_comparison::ordinal);}
1955 static int32 compare(const basic_string& str_a, const basic_string& str_b, xtd::string_comparison comparison_type) noexcept {return comparison_type == xtd::string_comparison::ordinal_ignore_case ? str_a.to_lower().compare(str_b.to_lower()) : str_a.compare(str_b);}
1968 static int32 compare(const basic_string& str_a, xtd::size index_a, const basic_string& str_b, xtd::size index_b, xtd::size length) {return compare(str_a, index_a, str_b, index_b, length, false);}
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);}
1996 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) {return comparison_type == xtd::string_comparison::ordinal_ignore_case ? str_a.substr(index_a, length).to_lower().compare(str_b.substr(index_b, length).to_lower()) : str_a.substr(index_a, length).compare(str_b.substr(index_b, length));}
1997
2004 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 {return str_a + str_b + str_c + str_d;}
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);}
2018 static basic_string concat(const basic_string& str_a, const basic_string& str_b, const basic_string& str_c) noexcept {return str_a + str_b + str_c;}
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);}
2030 static basic_string concat(const basic_string& str_a, const basic_string& str_b) noexcept {return str_a + str_b;}
2035 template<typename object_a_t, typename object_b_t>
2036 static basic_string concat(object_a_t obj_a, object_b_t obj_b) noexcept {return format("{}{}", obj_a, obj_b);}
2040 static basic_string concat(const xtd::array<basic_string>& values) noexcept;
2042 static basic_string concat(const xtd::array<const_pointer>& values) noexcept;
2043 template<typename other_char_t>
2044 static basic_string concat(const xtd::array<const other_char_t*>& values) noexcept;
2045 static basic_string concat(const std::initializer_list<basic_string>& values) noexcept {
2046 auto result = basic_string::empty_string;
2047 std::for_each(values.begin(), values.end(), [&](const auto & item) {result += item;});
2048 return result;
2049 }
2050 static basic_string concat(const std::initializer_list<const_pointer>& values) noexcept {
2051 auto result = basic_string::empty_string;
2052 std::for_each(values.begin(), values.end(), [&](const auto & item) {result += item;});
2053 return result;
2054 }
2055 template<typename other_char_t>
2056 static basic_string concat(const std::initializer_list<const other_char_t*>& values) noexcept {
2057 auto result = basic_string::empty_string;
2058 std::for_each(values.begin(), values.end(), [&](const auto & item) {result += item;});
2059 return result;
2060 }
2065 template<typename object_t>
2066 static basic_string concat(const xtd::array<object_t>& args) noexcept;
2068 template<typename object_t>
2069 static basic_string concat(const std::initializer_list<object_t>& args) noexcept {
2070 basic_string result;
2071 for (const auto& arg : args)
2072 result += format("{}", arg);
2073 return result;
2074 }
2079 template<typename value_t>
2080 static basic_string concat(value_t value) noexcept {
2081 return format("{}", value);
2082 }
2083
2104 static basic_string demangle(const basic_string& name) {return __xtd_demangle(__xtd_convert_to_string<char>(name.chars()));}
2105
2111 static bool equals(const basic_string& a, const basic_string& b) noexcept{return a.equals(b);}
2117 template<typename char_a_t, typename char_b_t>
2118 static bool equals(const char_a_t* a, const char_b_t* b) noexcept{return basic_string {a}.equals(basic_string {b});}
2119
2126 static bool equals(const basic_string& a, const basic_string& b, bool ignore_case) noexcept {return a.equals(b, ignore_case);}
2133 template<typename char_a_t, typename char_b_t>
2134 static bool equals(const char_a_t* a, const char_b_t* b, bool ignore_case) noexcept{return basic_string {a}.equals(basic_string {b}, ignore_case);}
2135
2142 template<typename ...args_t>
2143 static basic_string format(const basic_string<char>& fmt, args_t&& ... args);
2144
2149 template<typename object_t>
2150 [[deprecated("Replaced by typeof_<object_t>().full_name() - Will be removed in version 0.4.0")]]
2151 static basic_string full_class_name() {return demangle(typeid(object_t).name());}
2156 template<typename object_t>
2157 [[deprecated("Replaced by typeof_(object).full_name() - Will be removed in version 0.4.0")]]
2158 static basic_string full_class_name(const object_t& object) {return demangle(typeid(object).name());}
2163 [[deprecated("Replaced by typeof_(info).full_name() - Will be removed in version 0.4.0")]]
2164 static basic_string full_class_name(const std::type_info& info) {return __xtd_get_full_class_name(info);}
2165
2169 static bool is_empty(const xtd::basic_string<value_type, traits_type, allocator_type>& string) noexcept {return !string.length();}
2170
2177 template<typename collection_t>
2178 static basic_string join(const basic_string separator, const collection_t& values) noexcept {return join(separator, values, 0, values.size());}
2186 template<typename collection_t>
2187 static basic_string join(const basic_string& separator, const collection_t& values, xtd::size index) {return join(separator, values, index, values.size() - index);}
2196 template<typename collection_t>
2197 static basic_string join(const basic_string& separator, const collection_t& values, xtd::size index, xtd::size count) {
2198 if (index > values.size() || index + count > values.size()) __throw_basic_string_argument_out_of_range_exception(__FILE__, __LINE__, __func__);
2199 xtd::size i = 0;
2200 basic_string result;
2201 for (const auto& item : values) {
2202 if (i >= index) {
2203 if (i != index) result += separator;
2204 result += format("{}", item);
2205 }
2206 if (++i >= index + count) break;
2207 }
2208 return result;
2209 }
2211 template<typename value_t>
2212 static basic_string join(const basic_string& separator, const std::initializer_list<value_t>& values) noexcept;
2213 template<typename value_t>
2214 static basic_string join(const basic_string& separator, const std::initializer_list<value_t>& values, xtd::size index);
2215 template<typename value_t>
2216 static basic_string join(const basic_string& separator, const std::initializer_list<value_t>& values, xtd::size index, xtd::size count);
2218
2222 template<typename value_t>
2223 static value_t parse(const basic_string& str) {
2224 return xtd::parse<value_t>(__xtd_convert_to_string<char>(str.chars()));
2225 }
2226
2286 template<typename ... args_t>
2287 static basic_string sprintf(const basic_string& fmt, args_t&& ... args) noexcept {return __sprintf(fmt.c_str(), convert_param(std::forward<args_t>(args)) ...);}
2288
2293 template<typename value_t>
2294 static bool try_parse(const basic_string& str, value_t& value) noexcept {
2295 try {
2296 value = parse<value_t>(str);
2297 return true;
2298 } catch (...) {
2299 return false;
2300 }
2301 }
2303
2305
2312 if (index >= length()) __throw_basic_string_index_out_of_range_exception(__FILE__, __LINE__, __func__);
2313 return chars_[index];
2314 }
2315
2318 virtual operator const base_type&() const noexcept {return chars_;}
2319
2324 if constexpr(std::is_same<char_t, char>::value) chars_ = str.chars_;
2325 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
2326 return *this;
2327 }
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());
2334 return *this;
2335 }
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());
2342 return *this;
2343 }
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());
2351 return *this;
2352 }
2353#endif
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());
2360 return *this;
2361 }
2362
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_)));
2369 return *this;
2370 }
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_)));
2377 return *this;
2378 }
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_)));
2385 return *this;
2386 }
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_)));
2394 return *this;
2395 }
2396#endif
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_)));
2403 return *this;
2404 }
2405
2409 basic_string& operator =(const std::basic_string<char>& str) noexcept {
2410 if constexpr(std::is_same<char_t, char>::value) chars_ = str;
2411 else chars_ = __xtd_convert_to_string<value_type>(str);
2412 return *this;
2413 }
2417 basic_string& operator =(const std::basic_string<xtd::char16>& str) noexcept {
2418 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = str;
2419 else chars_ = __xtd_convert_to_string<value_type>(str);
2420 return *this;
2421 }
2425 basic_string& operator =(const std::basic_string<xtd::char32>& str) noexcept {
2426 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = str;
2427 else chars_ = __xtd_convert_to_string<value_type>(str);
2428 return *this;
2429 }
2430#if defined(__xtd__cpp_lib_char8_t)
2434 basic_string& operator =(const std::basic_string<xtd::char8>& str) noexcept {
2435 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = str;
2436 else chars_ = __xtd_convert_to_string<value_type>(str);
2437 return *this;
2438 }
2439#endif
2443 basic_string& operator =(const std::basic_string<xtd::wchar>& str) noexcept {
2444 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = str;
2445 else chars_ = __xtd_convert_to_string<value_type>(str);
2446 return *this;
2447 }
2448
2452 basic_string& operator =(std::basic_string<char>&& str) noexcept {
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)));
2455 return *this;
2456 }
2460 basic_string& operator =(std::basic_string<xtd::char16>&& str) noexcept {
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)));
2463 return *this;
2464 }
2468 basic_string& operator =(std::basic_string<xtd::char32>&& str) noexcept {
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)));
2471 return *this;
2472 }
2473#if defined(__xtd__cpp_lib_char8_t)
2477 basic_string& operator =(std::basic_string<xtd::char8>&& str) noexcept {
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)));
2480 return *this;
2481 }
2482#endif
2486 basic_string& operator =(std::basic_string<xtd::wchar>&& str) noexcept {
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)));
2489 return *this;
2490 }
2491
2496 basic_string& operator =(const char* 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));
2499 return *this;
2500 }
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));
2508 return *this;
2509 }
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));
2517 return *this;
2518 }
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));
2527 return *this;
2528 }
2529#endif
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));
2537 return *this;
2538 }
2539
2543 basic_string& operator =(char character) {
2544 *this = basic_string(1, character);
2545 return *this;
2546 }
2551 *this = basic_string(1, character);
2552 return *this;
2553 }
2558 *this = basic_string(1, character);
2559 return *this;
2560 }
2561#if defined(__xtd__cpp_lib_char8_t)
2566 *this = basic_string(1, character);
2567 return *this;
2568 }
2569#endif
2574 *this = basic_string(1, character);
2575 return *this;
2576 }
2577
2581 basic_string& operator =(const std::initializer_list<char>& il) {
2582 *this = basic_string(il);
2583 return *this;
2584 }
2588 basic_string& operator =(const std::initializer_list<xtd::char16>& il) {
2589 *this = basic_string(il);
2590 return *this;
2591 }
2595 basic_string& operator =(const std::initializer_list<xtd::char32>& il) {
2596 *this = basic_string(il);
2597 return *this;
2598 }
2599#if defined(__xtd__cpp_lib_char8_t)
2603 basic_string& operator =(const std::initializer_list<xtd::char8>& il) {
2604 *this = basic_string(il);
2605 return *this;
2606 }
2607#endif
2611 basic_string& operator =(const std::initializer_list<xtd::wchar>& il) {
2612 *this = basic_string(il);
2613 return *this;
2614 }
2615
2620 chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2621 return *this;
2622 }
2627 chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2628 return *this;
2629 }
2634 chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2635 return *this;
2636 }
2637#if defined(__xtd__cpp_lib_char8_t)
2642 chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2643 return *this;
2644 }
2645#endif
2650 chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2651 return *this;
2652 }
2653
2658 chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2659 return *this;
2660 }
2665 chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2666 return *this;
2667 }
2672 chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2673 return *this;
2674 }
2675#if defined(__xtd__cpp_lib_char8_t)
2680 chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2681 return *this;
2682 }
2683#endif
2688 chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2689 return *this;
2690 }
2691
2695 basic_string& operator +=(const std::basic_string<char>& str) {
2696 chars_ += __xtd_convert_to_string<value_type>(str);
2697 return *this;
2698 }
2702 basic_string& operator +=(const std::basic_string<xtd::char16>& str) {
2703 chars_ += __xtd_convert_to_string<value_type>(str);
2704 return *this;
2705 }
2709 basic_string& operator +=(const std::basic_string<xtd::char32>& str) {
2710 chars_ += __xtd_convert_to_string<value_type>(str);
2711 return *this;
2712 }
2713#if defined(__xtd__cpp_lib_char8_t)
2717 basic_string& operator +=(const std::basic_string<xtd::char8>& str) {
2718 chars_ += __xtd_convert_to_string<value_type>(str);
2719 return *this;
2720 }
2721#endif
2725 basic_string& operator +=(const std::basic_string<xtd::wchar>& str) {
2726 chars_ += __xtd_convert_to_string<value_type>(str);
2727 return *this;
2728 }
2729
2733 basic_string& operator +=(const char* str) {
2734 chars_ += basic_string(str).chars_;
2735 return *this;
2736 }
2741 chars_.append(basic_string(str).chars_); return *this;
2742 }
2747 chars_ += basic_string(str).chars_;
2748 return *this;
2749 }
2750#if defined(__xtd__cpp_lib_char8_t)
2755 chars_ += basic_string(str).chars_;
2756 return *this;
2757 }
2758#endif
2763 chars_ += basic_string(str).chars_;
2764 return *this;
2765 }
2770 chars_ += basic_string(1, ch).chars_;
2771 return *this;
2772 }
2777 chars_ += basic_string(1, ch).chars_;
2778 return *this;
2779 }
2784 chars_ += basic_string(1, ch).chars_;
2785 return *this;
2786 }
2787#if defined(__xtd__cpp_lib_char8_t)
2792 chars_ += basic_string(1, ch).chars_;
2793 return *this;
2794 }
2795#endif
2800 chars_ += basic_string(1, ch).chars_;
2801 return *this;
2802 }
2803
2809 auto result = lhs;
2810 result += rhs;
2811 return result;
2812 }
2818 auto result = lhs;
2819 result += rhs;
2820 return result;
2821 }
2827 auto result = lhs;
2828 result += rhs;
2829 return result;
2830 }
2831#if defined(__xtd__cpp_lib_char8_t)
2837 auto result = lhs;
2838 result += rhs;
2839 return result;
2840 }
2841#endif
2847 auto result = lhs;
2848 result += rhs;
2849 return result;
2850 }
2851
2857 auto result = std::move(lhs);
2858 result += std::move(rhs);
2859 return result;
2860 }
2866 auto result = std::move(lhs);
2867 result += std::move(rhs);
2868 return result;
2869 }
2875 auto result = std::move(lhs);
2876 result += std::move(rhs);
2877 return result;
2878 }
2879#if defined(__xtd__cpp_lib_char8_t)
2885 auto result = std::move(lhs);
2886 result += std::move(rhs);
2887 return result;
2888 }
2889#endif
2895 auto result = std::move(lhs);
2896 result += std::move(rhs);
2897 return result;
2898 }
2899
2905 auto result = std::move(lhs);
2906 result += rhs;
2907 return result;
2908 }
2914 auto result = std::move(lhs);
2915 result += rhs;
2916 return result;
2917 }
2923 auto result = std::move(lhs);
2924 result += rhs;
2925 return result;
2926 }
2927#if defined(__xtd__cpp_lib_char8_t)
2933 auto result = std::move(lhs);
2934 result += rhs;
2935 return result;
2936 }
2937#endif
2943 auto result = std::move(lhs);
2944 result += rhs;
2945 return result;
2946 }
2947
2953 auto result = lhs;
2954 result += std::move(rhs);
2955 return result;
2956 }
2962 auto result = lhs;
2963 result += std::move(rhs);
2964 return result;
2965 }
2971 auto result = lhs;
2972 result += std::move(rhs);
2973 return result;
2974 }
2975#if defined(__xtd__cpp_lib_char8_t)
2981 auto result = lhs;
2982 result += std::move(rhs);
2983 return result;
2984 }
2985#endif
2991 auto result = lhs;
2992 result += std::move(rhs);
2993 return result;
2994 }
2995
3000 friend basic_string operator +(const basic_string& lhs, const std::basic_string<char>& rhs) {
3001 auto result = lhs;
3002 result += rhs;
3003 return result;
3004 }
3009 friend basic_string operator +(const basic_string& lhs, const std::basic_string<xtd::char16>& rhs) {
3010 auto result = lhs;
3011 result += rhs;
3012 return result;
3013 }
3018 friend basic_string operator +(const basic_string& lhs, const std::basic_string<xtd::char32>& rhs) {
3019 auto result = lhs;
3020 result += rhs;
3021 return result;
3022 }
3023#if defined(__xtd__cpp_lib_char8_t)
3028 friend basic_string operator +(const basic_string& lhs, const std::basic_string<xtd::char8>& rhs) {
3029 auto result = lhs;
3030 result += rhs;
3031 return result;
3032 }
3033#endif
3038 friend basic_string operator +(const basic_string& lhs, const std::basic_string<xtd::wchar>& rhs) {
3039 auto result = lhs;
3040 result += rhs;
3041 return result;
3042 }
3043
3048 friend basic_string operator +(const std::basic_string<char>& lhs, const basic_string& rhs) {
3049 auto result = lhs;
3050 result += __xtd_convert_to_string<char>(rhs.chars());
3051 return result;
3052 }
3057 friend basic_string operator +(const std::basic_string<xtd::char16>& lhs, const basic_string& rhs) {
3058 auto result = lhs;
3059 result += __xtd_convert_to_string<xtd::char16>(rhs.chars());
3060 return result;
3061 }
3066 friend basic_string operator +(const std::basic_string<xtd::char32>& lhs, const basic_string& rhs) {
3067 auto result = lhs;
3068 result += __xtd_convert_to_string<xtd::char32>(rhs.chars());
3069 return result;
3070 }
3071#if defined(__xtd__cpp_lib_char8_t)
3076 friend basic_string operator +(const std::basic_string<xtd::char8>& lhs, const basic_string& rhs) {
3077 auto result = lhs;
3078 result += __xtd_convert_to_string<xtd::char8>(rhs.chars());
3079 return result;
3080 }
3081#endif
3086 friend basic_string operator +(const std::basic_string<xtd::wchar>& lhs, const basic_string& rhs) {
3087 auto result = lhs;
3088 result += __xtd_convert_to_string<xtd::wchar>(rhs.chars());
3089 return result;
3090 }
3091
3096 friend basic_string operator +(const basic_string& lhs, const char* rhs) {
3097 auto result = lhs;
3098 result += rhs;
3099 return result;
3100 }
3105 friend basic_string operator +(const basic_string& lhs, const xtd::char16* rhs) {
3106 auto result = lhs;
3107 result += rhs;
3108 return result;
3109 }
3114 friend basic_string operator +(const basic_string& lhs, const xtd::char32* rhs) {
3115 auto result = lhs;
3116 result += rhs;
3117 return result;
3118 }
3119#if defined(__xtd__cpp_lib_char8_t)
3124 friend basic_string operator +(const basic_string& lhs, const xtd::char8* rhs) {
3125 auto result = lhs;
3126 result += rhs;
3127 return result;
3128 }
3129#endif
3134 friend basic_string operator +(const basic_string& lhs, const xtd::wchar* rhs) {
3135 auto result = lhs;
3136 result += rhs;
3137 return result;
3138 }
3139
3144 friend basic_string operator +(basic_string&& lhs, const char* rhs) {
3145 auto result = std::move(lhs);
3146 result += rhs;
3147 return result;
3148 }
3154 auto result = std::move(lhs);
3155 result += rhs;
3156 return result;
3157 }
3163 auto result = std::move(lhs);
3164 result += rhs;
3165 return result;
3166 }
3167#if defined(__xtd__cpp_lib_char8_t)
3173 auto result = std::move(lhs);
3174 result += rhs;
3175 return result;
3176 }
3177#endif
3183 auto result = std::move(lhs);
3184 result += rhs;
3185 return result;
3186 }
3187
3192 friend basic_string operator +(const char* lhs, const basic_string& rhs) {
3193 auto result = basic_string(lhs);
3194 result += rhs;
3195 return result;
3196 }
3201 friend basic_string operator +(const xtd::char16* lhs, const basic_string& rhs) {
3202 auto result = basic_string(lhs);
3203 result += rhs;
3204 return result;
3205 }
3210 friend basic_string operator +(const xtd::char32* lhs, const basic_string& rhs) {
3211 auto result = basic_string(lhs);
3212 result += rhs;
3213 return result;
3214 }
3215#if defined(__xtd__cpp_lib_char8_t)
3220 friend basic_string operator +(const xtd::char8* lhs, const basic_string& rhs) {
3221 auto result = basic_string(lhs);
3222 result += rhs;
3223 return result;
3224 }
3225#endif
3230 friend basic_string operator +(const xtd::wchar* lhs, const basic_string& rhs) {
3231 auto result = basic_string(lhs);
3232 result += rhs;
3233 return result;
3234 }
3235
3240 friend basic_string operator +(const char* lhs, basic_string&& rhs) {
3241 auto result = basic_string(lhs);
3242 result += std::move(rhs);
3243 return result;
3244 }
3250 auto result = basic_string(lhs);
3251 result += std::move(rhs);
3252 return result;
3253 }
3259 auto result = basic_string(lhs);
3260 result += std::move(rhs);
3261 return result;
3262 }
3263
3264#if defined(__xtd__cpp_lib_char8_t)
3270 auto result = basic_string(lhs);
3271 result += std::move(rhs);
3272 return result;
3273 }
3274#endif
3280 auto result = basic_string(lhs);
3281 result += std::move(rhs);
3282 return result;
3283 }
3284
3289 friend basic_string operator +(const basic_string& lhs, const char rhs) {
3290 auto result = lhs;
3291 result += rhs;
3292 return result;
3293 }
3298 friend basic_string operator +(const basic_string& lhs, const xtd::char16 rhs) {
3299 auto result = lhs;
3300 result += rhs;
3301 return result;
3302 }
3307 friend basic_string operator +(const basic_string& lhs, const xtd::char32 rhs) {
3308 auto result = lhs;
3309 result += rhs;
3310 return result;
3311 }
3312#if defined(__xtd__cpp_lib_char8_t)
3317 friend basic_string operator +(const basic_string& lhs, const xtd::char8 rhs) {
3318 auto result = lhs;
3319 result += rhs;
3320 return result;
3321 }
3322#endif
3327 friend basic_string operator +(const basic_string& lhs, const xtd::wchar rhs) {
3328 auto result = lhs;
3329 result += rhs;
3330 return result;
3331 }
3332
3337 friend basic_string operator +(basic_string&& lhs, const char rhs) {
3338 auto result = std::move(lhs);
3339 result += rhs;
3340 return result;
3341 }
3347 auto result = std::move(lhs);
3348 result += rhs;
3349 return result;
3350 }
3356 auto result = std::move(lhs);
3357 result += rhs;
3358 return result;
3359 }
3360#if defined(__xtd__cpp_lib_char8_t)
3366 auto result = std::move(lhs);
3367 result += rhs;
3368 return result;
3369 }
3370#endif
3376 auto result = std::move(lhs);
3377 result += rhs;
3378 return result;
3379 }
3380
3385 friend basic_string operator +(char lhs, const basic_string& rhs) {
3386 auto result = basic_string(1, lhs);
3387 result += rhs;
3388 return result;
3389 }
3395 auto result = basic_string(1, lhs);
3396 result += rhs;
3397 return result;
3398 }
3404 auto result = basic_string(1, lhs);
3405 result += rhs;
3406 return result;
3407 }
3408#if defined(__xtd__cpp_lib_char8_t)
3414 auto result = basic_string(1, lhs);
3415 result += rhs;
3416 return result;
3417 }
3418#endif
3424 auto result = basic_string(1, lhs);
3425 result += rhs;
3426 return result;
3427 }
3428
3433 friend basic_string operator +(char lhs, basic_string&& rhs) {
3434 auto result = basic_string(1, lhs);
3435 result += std::move(rhs);
3436 return result;
3437 }
3443 auto result = basic_string(1, lhs);
3444 result += std::move(rhs);
3445 return result;
3446 }
3452 auto result = basic_string(1, lhs);
3453 result += std::move(rhs);
3454 return result;
3455 }
3456#if defined(__xtd__cpp_lib_char8_t)
3462 auto result = basic_string(1, lhs);
3463 result += std::move(rhs);
3464 return result;
3465 }
3466#endif
3472 auto result = basic_string(1, lhs);
3473 result += std::move(rhs);
3474 return result;
3475 }
3476
3485 //friend std::basic_ostream<char>& operator <<(std::basic_ostream<char>& stream, const basic_string& str) {return stream << str.to_string().chars_;}
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());}
3493 friend std::basic_ostream<xtd::wchar>& operator <<(std::basic_ostream<xtd::wchar>& stream, const basic_string& str) {return stream << str.to_wstring().chars();}
3494
3503 friend std::basic_istream<char>& operator >>(std::basic_istream<char>& stream, basic_string& str) {
3504 auto s = std::basic_string<char> {};
3505 stream >> s;
3506 str = s;
3507 return stream;
3508 }
3517 friend std::basic_istream<xtd::wchar>& operator >>(std::basic_istream<xtd::wchar>& stream, basic_string& str) {
3518 auto s = std::basic_string<xtd::wchar> {};
3519 stream >> s;
3520 str = s;
3521 return stream;
3522 }
3524
3525 private:
3526 friend class basic_string<char>;
3527 friend class basic_string<xtd::char16>;
3528 friend class basic_string<xtd::char32>;
3529#if defined(__xtd__cpp_lib_char8_t)
3530 friend class basic_string<xtd::char8>;
3531#endif
3532 friend class basic_string<xtd::wchar>;
3533
3534 static const xtd::array<value_type> default_split_separators;
3535 static const xtd::array<value_type> default_trim_chars;
3536
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();
3544#endif
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);
3548 }
3549
3550 static basic_string get_class_name(const basic_string& full_name) {
3551 auto length = full_name.last_index_of("<");
3552 if (length == npos) length = full_name.length();
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);
3555 }
3556
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());
3561 }
3562
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());
3567 }
3568
3569 base_type chars_;
3570 };
3571}
3572
3573#define __XTD_BASIC_STRING_INTERNAL__
3574#include "basic_string.hpp"
3575#undef __XTD_BASIC_STRING_INTERNAL__
Contains array definitions.
Contains __format_information struct.
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.
static basic_string sprintf(const basic_string &fmt, args_t &&... args) noexcept
Writes the text representation of the specified arguments list, to basic_string using the specified f...
Definition basic_string.h:2287
static basic_string format(const basic_string< char > &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
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...
@ s
The S key.
@ a
The A key.
@ c
The C key.
@ i
The I key.
@ b
The B key.
@ 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.