6#define __XTD_CORE_INTERNAL__
11#undef __XTD_CORE_INTERNAL__
12#define __XTD_STD_INTERNAL__
14#undef __XTD_STD_INTERNAL__
35template<
class ...args_t>
37template<
class target_t,
class source_t>
38std::basic_string<target_t> __xtd_convert_to_string(std::basic_string<source_t>&& str)
noexcept;
39template<
class target_t,
class source_t>
40std::basic_string<target_t> __xtd_convert_to_string(
const std::basic_string<source_t>& str)
noexcept;
41std::basic_string<char> __xtd_demangle(
const std::basic_string<char>& value)
noexcept;
42std::basic_string<char> __xtd_get_class_name(
const std::type_info& value)
noexcept;
43std::basic_string<char> __xtd_get_full_class_name(
const std::type_info& value)
noexcept;
66 template<
class char_t,
class traits_t,
class allocator_t>
74 using base_type = std::basic_string<char_t, traits_t, allocator_t>;
76 using traits_type =
typename base_type::traits_type;
78 using value_type =
typename base_type::value_type;
80 using allocator_type =
typename base_type::allocator_type;
82 using size_type =
typename base_type::size_type;
84 using difference_type =
typename base_type::difference_type;
86 using reference =
typename base_type::reference;
88 using const_reference =
typename base_type::const_reference;
90 using pointer =
typename base_type::pointer;
92 using const_pointer =
typename base_type::const_pointer;
100 using reverse_iterator =
typename base_type::reverse_iterator;
102 using const_reverse_iterator =
typename base_type::const_reverse_iterator;
122 inline static constexpr size_type
npos = base_type::npos;
163 basic_string(std::basic_string<char_t>&& str) : chars_ {std::move(str)} {}
167 if constexpr(std::is_same_v<char, char_t>) chars_ = str.chars_;
168 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
173 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ = str.chars_;
174 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
179 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ = str.chars_;
180 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
185 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ = str.chars_;
186 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
191 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ = str.chars_;
192 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
196 basic_string(
const std::basic_string<char>& str)
noexcept {
197 if constexpr(std::is_same_v<char, char_t>) chars_ = str;
198 else chars_ = __xtd_convert_to_string<value_type>(str);
202 basic_string(
const std::basic_string<xtd::char16>& str)
noexcept {
203 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ = str;
204 else chars_ = __xtd_convert_to_string<value_type>(str);
208 basic_string(
const std::basic_string<xtd::char32>& str)
noexcept {
209 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ = str;
210 else chars_ = __xtd_convert_to_string<value_type>(str);
214 basic_string(
const std::basic_string<xtd::char8>& str)
noexcept {
215 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ = str;
216 else chars_ = __xtd_convert_to_string<value_type>(str);
220 basic_string(
const std::basic_string<xtd::wchar>& str)
noexcept {
221 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ = str;
222 else chars_ = __xtd_convert_to_string<value_type>(str);
248 if constexpr(std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str);
249 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str));
255 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str);
256 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str));
262 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str);
263 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str));
269 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str);
270 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str));
276 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str);
277 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
284 if constexpr(std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str,
count);
285 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str,
count));
291 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str,
count);
292 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str,
count));
298 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str,
count);
299 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str,
count));
305 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str,
count);
306 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str,
count));
312 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str,
count);
313 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str,
count));
318 template<
class input_iterator_t>
322 basic_string(
const std::basic_string_view<char_t>& str) : chars_(str) {}
351 const_pointer c_str()
const noexcept {
return chars_.c_str();}
355 const base_type& chars()
const noexcept {
return chars_;}
358 base_type& chars()
noexcept {
return chars_;}
363 virtual size_type
count()
const noexcept {
return chars_.size();}
372 const_pointer
data()
const noexcept {
return chars_.data();}
376 virtual bool empty()
const noexcept {
return length() == 0;}
381 virtual size_type
length()
const noexcept {
return chars_.size();}
386 virtual size_type
size()
const noexcept {
return chars_.size();}
432 int32 compare(size_type pos1, size_type count1,
const basic_string & str)
const {
return chars_.compare(pos1, count1, str);}
456 int32 compare(size_type pos1, size_type count1,
const basic_string & str, size_type pos2)
const {
return chars_.compare(pos1, count1, str, pos2);}
481 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);}
500 int32 compare(const_pointer
s)
const {
return chars_.compare(
s);}
522 int32 compare(size_type pos1, size_type count1, const_pointer
s)
const {
return chars_.compare(pos1, count1,
s);}
545 int32 compare(size_type pos1, size_type count1, const_pointer
s, size_type count2)
const {
return chars_.compare(pos1, count1,
s, count2);}
594 if (ignore_case)
return to_upper().chars_ == value.to_upper().chars_;
595 return chars_ == value.chars_;
608 return chars_.rfind(value) ==
length() - 1;
625 return chars_.rfind(value) + value.length() ==
length();
637 size_type
find(
const basic_string & str, size_type pos)
const {
return chars_.find(str, pos);}
645 size_type
find(const_pointer
s, size_type pos, size_type
count)
const {
return chars_.find(
s, pos,
count);}
651 size_type
find(const_pointer
s)
const {
return chars_.find(
s);}
658 size_type
find(const_pointer
s, size_type pos)
const {
return chars_.find(
s, pos);}
669 size_type
find(
value_type ch, size_type pos)
const {
return chars_.find(ch, pos);}
702 size_type
find_first_of(const_pointer
s, size_type pos)
const {
return chars_.find_first_of(
s, pos);}
713 size_type
find_first_of(char_t ch, size_type pos)
const {
return chars_.find_first_of(ch, pos);}
746 size_type
find_first_not_of(const_pointer
s, size_type pos)
const {
return chars_.find_first_not_of(
s, pos);}
757 size_type
find_first_not_of(char_t ch, size_type pos)
const {
return chars_.find_first_not_of(ch, pos);}
790 size_type
find_last_of(const_pointer
s, size_type pos)
const {
return chars_.find_last_of(
s, pos);}
795 size_type
find_last_of(char_t ch)
const {
return chars_.find_last_of(ch);}
801 size_type
find_last_of(char_t ch, size_type pos)
const {
return chars_.find_last_of(ch, pos);}
834 size_type
find_last_not_of(const_pointer
s, size_type pos)
const {
return chars_.find_last_not_of(
s, pos);}
845 size_type
find_last_not_of(char_t ch, size_type pos)
const {
return chars_.find_last_not_of(ch, pos);}
861 explicit basic_string_enumerator(
const basic_string & chars) : chars_(chars) {}
864 return chars_[index_];
866 bool move_next()
override {
return ++index_ < chars_.length();}
867 void reset()
override {index_ = basic_string::npos;}
871 size_type index_ = basic_string::npos;
893 auto result =
find(value, start_index);
894 return result > start_index +
count ?
npos : result;
913 auto result =
find(value, start_index);
914 return result > start_index +
count ?
npos : result;
949 result.chars_.insert(start_index, value);
971 auto result = chars_.rfind(value, start_index +
count - value.length());
972 return result < start_index ?
npos : result;
993 auto result = chars_.rfind(value, start_index +
count - 1);
994 return result < start_index ?
npos : result;
1062 std::wstringstream ss;
1063 if constexpr(std::is_same_v<xtd::wchar, value_type>) ss << std::quoted(chars_, delimiter,
escape);
1064 else ss << std::quoted(__xtd_convert_to_string<xtd::wchar>(chars_),
static_cast<xtd::wchar>(delimiter),
static_cast<xtd::wchar>(
escape));
1078 auto result =
self_;
1079 result.chars_.erase(start_index,
count);
1094 auto result =
self_;
1095 auto old_size = old_string.length();
1096 auto new_size = new_string.length();
1099 index = result.find(old_string, index);
1100 if (index ==
npos)
break;
1101 if (old_size == new_size) result.chars_.replace(index, old_size, new_string);
1103 result.chars_.erase(index, old_string.length());
1104 result.chars_.insert(index, new_string);
1106 index += new_string.length();
1128 size_type
rfind(const_pointer
s, size_type pos, size_type
count)
const {
return chars_.rfind(
s, pos,
count);}
1134 size_type
rfind(const_pointer
s)
const {
return chars_.rfind(
s);}
1141 size_type
rfind(const_pointer
s, size_type pos)
const {
return chars_.rfind(
s, pos);}
1260 return find(value) == 0;
1279 return find(value) == 0;
1294 return chars_.substr(pos);
1304 return chars_.substr(pos,
count);
1314 return substr(start_index);
1351 auto result = basic_string::empty_string;
1352 std::for_each(chars_.begin(), chars_.end(), [&](
auto c) {result += static_cast<value_type>(std::tolower(c));});
1360 if constexpr(std::is_same_v<char, char_t>)
return chars_;
1361 else return __xtd_convert_to_string<char>(chars_);
1371 if constexpr(std::is_same_v<xtd::char16, char_t>)
return chars_;
1372 else return __xtd_convert_to_string<xtd::char16>(chars_);
1378 if constexpr(std::is_same_v<xtd::char32, char_t>)
return chars_;
1379 else return __xtd_convert_to_string<xtd::char32>(chars_);
1385 if constexpr(std::is_same_v<xtd::char8, char_t>)
return chars_;
1386 else return __xtd_convert_to_string<xtd::char8>(chars_);
1392 auto result = basic_string::empty_string;
1393 std::for_each(chars_.begin(), chars_.end(), [&](
auto c) {result += static_cast<value_type>(std::toupper(c));});
1400 if constexpr(std::is_same_v<xtd::wchar, char_t>)
return chars_;
1401 else return __xtd_convert_to_string<xtd::wchar>(chars_);
1514 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);}
1543 template<
class object_a_t,
class object_b_t,
class object_c_t,
class object_d_t>
1544 inline 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);}
1556 template<
class object_a_t,
class object_b_t,
class object_c_t>
1557 inline 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);}
1567 template<
class object_a_t,
class object_b_t>
1575 template<
class other_
char_t>
1577 static basic_string concat(
const std::initializer_list<basic_string>& values)
noexcept {
1578 auto result = basic_string::empty_string;
1579 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
1582 static basic_string concat(
const std::initializer_list<const_pointer>& values)
noexcept {
1583 auto result = basic_string::empty_string;
1584 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
1587 template<
class other_
char_t>
1588 inline static basic_string
concat(
const std::initializer_list<const other_char_t*>& values)
noexcept {
1589 auto result = basic_string::empty_string;
1590 std::for_each(values.begin(), values.end(), [&](
const auto & item) {result += item;});
1597 template<
class object_t>
1600 template<
class object_t>
1601 inline static basic_string concat(
const std::initializer_list<object_t>& args)
noexcept {
1603 for (
const auto& arg : args)
1604 result +=
format(
"{}", arg);
1611 template<
class value_t>
1613 return format(
"{}", value);
1637 if constexpr(std::is_same_v<char, char_t>)
return __xtd_demangle(name.chars());
1638 else return __xtd_demangle(__xtd_convert_to_string<char>(name.chars()));
1652 template<
class char_a_t,
class char_b_t>
1668 template<
class char_a_t,
class char_b_t>
1677 template<
class ...args_t>
1687 template<
class ...args_t>
1701 template<
class collection_t>
1705 for (
const auto& item : values)
1716 template<
class collection_t>
1726 template<
class collection_t>
1731 for (
const auto& item : values) {
1733 if (++
i >= index +
count)
break;
1739 template<
class value_t>
1741 template<
class value_t>
1743 template<
class value_t>
1750 template<
class value_t>
1815 template<
class ...args_t>
1816 inline static basic_string sprintf(
const basic_string & fmt, args_t&& ... args)
noexcept {
return __sprintf(fmt.chars().c_str(), convert_param(std::forward<args_t>(args)) ...);}
1822 template<
class value_t>
1842 return chars_[index ==
epos ?
length() - 1 : index];
1847 operator const base_type& ()
const noexcept {
return chars_;}
1853 if constexpr(std::is_same<char_t, char>::value) chars_ = str.chars_;
1854 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
1861 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = str.chars_;
1862 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
1869 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = str.chars_;
1870 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
1877 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = str.chars_;
1878 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
1885 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = str.chars_;
1886 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
1894 if constexpr(std::is_same<char_t, char>::value) chars_ = std::move(str.chars_);
1895 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
1902 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = std::move(str.chars_);
1903 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
1910 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = std::move(str.chars_);
1911 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
1918 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = std::move(str.chars_);
1919 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
1926 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = std::move(str.chars_);
1927 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
1935 if constexpr(std::is_same<char_t, char>::value) chars_ = str;
1936 else chars_ = __xtd_convert_to_string<value_type>(str);
1943 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = str;
1944 else chars_ = __xtd_convert_to_string<value_type>(str);
1951 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = str;
1952 else chars_ = __xtd_convert_to_string<value_type>(str);
1959 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = str;
1960 else chars_ = __xtd_convert_to_string<value_type>(str);
1967 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = str;
1968 else chars_ = __xtd_convert_to_string<value_type>(str);
1976 if constexpr(std::is_same<char_t, char>::value) chars_ = std::move(str);
1977 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
1984 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = std::move(str);
1985 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
1992 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = std::move(str);
1993 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2000 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = std::move(str);
2001 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2008 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = std::move(str);
2009 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
2019 if constexpr(std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str);
2020 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str));
2029 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str);
2030 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str));
2039 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str);
2040 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str));
2049 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str);
2050 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str));
2059 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str);
2060 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
2140 if constexpr(std::is_same_v<char, char_t>) chars_ += str.chars_;
2141 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2148 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ += str.chars_;
2149 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2156 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ += str.chars_;
2157 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2164 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ += str.chars_;
2165 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2172 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ += str.chars_;
2173 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
2181 if constexpr(std::is_same_v<char, char_t>) chars_ += std::move(str.chars_);
2182 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2189 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ += std::move(str.chars_);
2190 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2197 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ += std::move(str.chars_);
2198 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2205 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ += std::move(str.chars_);
2206 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2213 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ += std::move(str.chars_);
2214 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
2222 if constexpr(std::is_same_v<char, char_t>) chars_ += str;
2223 else chars_ += __xtd_convert_to_string<value_type>(str);
2230 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ += str;
2231 else chars_ += __xtd_convert_to_string<value_type>(str);
2238 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ += str;
2239 else chars_ += __xtd_convert_to_string<value_type>(str);
2246 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ += str;
2247 else chars_ += __xtd_convert_to_string<value_type>(str);
2254 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ += str;
2255 else chars_ += __xtd_convert_to_string<value_type>(str);
2380 auto result = std::move(lhs);
2381 result += std::move(rhs);
2389 auto result = std::move(lhs);
2390 result += std::move(rhs);
2398 auto result = std::move(lhs);
2399 result += std::move(rhs);
2407 auto result = std::move(lhs);
2408 result += std::move(rhs);
2416 auto result = std::move(lhs);
2417 result += std::move(rhs);
2426 auto result = std::move(lhs);
2435 auto result = std::move(lhs);
2444 auto result = std::move(lhs);
2453 auto result = std::move(lhs);
2462 auto result = std::move(lhs);
2473 result += std::move(rhs);
2482 result += std::move(rhs);
2491 result += std::move(rhs);
2500 result += std::move(rhs);
2509 result += std::move(rhs);
2565 if constexpr(std::is_same_v<char, char_t>) result += rhs.chars();
2566 else result += __xtd_convert_to_string<char>(rhs.chars());
2575 if constexpr(std::is_same_v<xtd::char16, char_t>) result += rhs.chars();
2576 else result += __xtd_convert_to_string<xtd::char16>(rhs.chars());
2585 if constexpr(std::is_same_v<xtd::char32, char_t>) result += rhs.chars();
2586 else result += __xtd_convert_to_string<xtd::char32>(rhs.chars());
2595 if constexpr(std::is_same_v<xtd::char8, char_t>) result += rhs.chars();
2596 else result += __xtd_convert_to_string<xtd::char8>(rhs.chars());
2605 if constexpr(std::is_same_v<xtd::wchar, char_t>) result += rhs.chars();
2606 else result += __xtd_convert_to_string<xtd::wchar>(rhs.chars());
2661 auto result = std::move(lhs);
2670 auto result = std::move(lhs);
2679 auto result = std::move(lhs);
2688 auto result = std::move(lhs);
2697 auto result = std::move(lhs);
2754 result += std::move(rhs);
2763 result += std::move(rhs);
2772 result += std::move(rhs);
2781 result += std::move(rhs);
2790 result += std::move(rhs);
2845 auto result = std::move(lhs);
2854 auto result = std::move(lhs);
2863 auto result = std::move(lhs);
2872 auto result = std::move(lhs);
2881 auto result = std::move(lhs);
2938 result += std::move(rhs);
2947 result += std::move(rhs);
2956 result += std::move(rhs);
2965 result += std::move(rhs);
2974 result += std::move(rhs);
2988 if constexpr(std::is_same_v<char, char_t>)
return stream << str.chars();
2989 else return stream << __xtd_convert_to_string<char>(str.chars());
3008 auto s = std::basic_string<char> {};
3022 auto s = std::basic_string<xtd::wchar> {};
3034 [[deprecated(
"Replaced by xtd::basic_string::is_empty(const xtd::basic_string&) - Will be removed in version 0.4.0.")]]
3044 template<
class object_t>
3045 [[deprecated(
"Replaced by typeof_<object_t>().name() - Will be removed in version 0.4.0.")]]
3051 template<
class object_t>
3052 [[deprecated(
"Replaced by typeof_(object).name() - Will be removed in version 0.4.0.")]]
3058 [[deprecated(
"Replaced by typeof_(info).name() - Will be removed in version 0.4.0.")]]
3064 template<
class object_t>
3065 [[deprecated(
"Replaced by typeof_<object_t>().full_name() - Will be removed in version 0.4.0.")]]
3071 template<
class object_t>
3072 [[deprecated(
"Replaced by typeof_(object).full_name() - Will be removed in version 0.4.0.")]]
3078 [[deprecated(
"Replaced by typeof_(info).full_name() - Will be removed in version 0.4.0.")]]
3089 static const
xtd::array<value_type> default_split_separators;
3090 static const
xtd::array<value_type> default_trim_chars;
3092 template<class arg_t>
3093 inline static auto convert_param(arg_t&& arg) noexcept {
3094 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();
3095 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();
3096 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();
3097 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();
3098 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();
3099 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();
3100 else return std::forward<arg_t>(arg);
3103 static basic_string get_class_name(
const basic_string & full_name) {
3104 auto length = full_name.last_index_of(
"<");
3106 if (full_name.last_index_of(
"::", 0,
length) ==
npos)
return full_name;
3107 return full_name.substring(full_name.last_index_of(
"::", 0,
length) + 2);
3114#define __XTD_BASIC_STRING_INTERNAL__
3116#undef __XTD_BASIC_STRING_INTERNAL__
Contains xtd::array definitions.
Contains __format method.
Contains string definitions.
Contains __xtd_std_version definitions.
Contains xtd::basic_string class.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Represents text as a sequence of character units.
Definition basic_string.hpp:67
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...
static basic_string concat(object_a_t obj_a, object_b_t obj_b) noexcept
Concatenates two specified instances of object.
Definition basic_string.hpp:1568
xtd::size index_of(value_type value) const noexcept
Reports the index of the first occurrence of the specified character in this basic_string.
Definition basic_string.hpp:899
static int32 compare(const basic_string &str_a, const basic_string &str_b, xtd::string_comparison comparison_type) noexcept
Compares two specified basic_string objects using the specified rules, and returns an integer that in...
Definition basic_string.hpp:1487
basic_string trim_end(const xtd::array< value_type > &trim_chars) const noexcept
Removes all trailing occurrences of a set of characters specified in an array from the specified xtd:...
basic_string to_lower() const noexcept
Returns a copy of the current xtd::basic_string converted to lowercase.
Definition basic_string.hpp:1350
static value_t parse(const basic_string &str)
Converts a basic_string into a value_t type.
Definition basic_string.hpp:1751
basic_string pad_left(xtd::size total_width) const noexcept
Right-aligns the characters in this basic_string, padding with spaces on the left for a specified tot...
Definition basic_string.hpp:1023
bool ends_with(const basic_string &value, xtd::string_comparison comparison_type) const noexcept
Determines whether the end of this basic_string matches the specified basic_string when compared usin...
Definition basic_string.hpp:623
static basic_string class_name(const object_t &object)
Gets the class name of the specified object.
Definition basic_string.hpp:3053
size_type find_last_not_of(const_pointer s, size_type pos, size_type count) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:821
allocator_type get_allocator() const
Returns the allocator associated with the string.
Definition basic_string.hpp:849
xtd::size index_of(value_type value, xtd::size start_index, xtd::size count) const
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:911
xtd::size index_of(value_type value, xtd::size start_index) const
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:904
basic_string trim() const noexcept
Removes all leading and trailing occurrences of white-space characters from the specified xtd::basic_...
Definition basic_string.hpp:1408
xtd::array< basic_string > split() const noexcept
Splits this basic_string into substrings that are based on the default white-space characters....
size_type find_first_of(const basic_string &str) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string.hpp:675
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...
basic_string substring(xtd::size start_index, xtd::size length) const
Retrieves a substring from this instance. The substring starts at a specified character position and ...
Definition basic_string.hpp:1321
size_type find_last_of(char_t ch, size_type pos) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string.hpp:801
bool ends_with(value_type value, bool ignore_case) const noexcept
Determines whether the end of this basic_string matches the specified character, ignoring or honoring...
Definition basic_string.hpp:606
enumerator_type get_enumerator() const noexcept override
Returns an enumerator that iterates through a collection.
Definition basic_string.hpp:859
static basic_string demangle(const basic_string &name)
Gets demangled basic_string of name,.
Definition basic_string.hpp:1636
size_type rfind(const_pointer s, size_type pos, size_type count) const
Finds the last substring that is equal to the given character sequence. The search begins at pos and ...
Definition basic_string.hpp:1128
size_type find_last_not_of(char_t ch, size_type pos) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:845
size_type rfind(const_pointer s) const
Finds the last substring that is equal to the given character sequence. The search begins at xtd::bas...
Definition basic_string.hpp:1134
size_type rfind(const basic_string &str) const
Finds the last substring that is equal to the given character sequence. The search begins at xtd::bas...
Definition basic_string.hpp:1114
static bool try_parse(const basic_string &str, value_t &value) noexcept
Try to convert a basic_string into a value_t type.
Definition basic_string.hpp:1823
virtual const base_type & get_base_type() const noexcept
Returns the underlying base type.
Definition basic_string.hpp:853
size_type find_first_not_of(const_pointer s, size_type pos) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:746
xtd::size last_index_of(const basic_string &value, xtd::size start_index) const
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:962
size_type find_last_of(const_pointer s) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string.hpp:783
static basic_string full_class_name(const std::type_info &info)
Gets the fully qualified class name of the specified object, including the namespace of the specified...
Definition basic_string.hpp:3079
friend std::basic_istream< char > & operator>>(std::basic_istream< char > &stream, basic_string &str)
Input stream operator. Behaves as a FormattedInputFunction. After constructing and checking the sentr...
Definition basic_string.hpp:3007
size_type find_last_of(const_pointer s, size_type pos) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string.hpp:790
static basic_string join(const basic_string &separator, const collection_t &values) noexcept
Concatenates a specified separator basic_string between each element of a specified object array,...
Definition basic_string.hpp:1702
size_type find_first_not_of(const basic_string &str) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:719
static basic_string concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c, object_d_t obj_d) noexcept
Concatenates four specified instances of object.
Definition basic_string.hpp:1544
bool starts_with(const basic_string &value) const noexcept
Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic...
Definition basic_string.hpp:1266
virtual bool contains(const basic_string &value) const noexcept
Returns a value indicating whether a specified substring occurs within this basic_string.
Definition basic_string.hpp:577
size_type find_first_of(const basic_string &str, size_type pos) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string.hpp:681
static bool equals(const basic_string &a, const basic_string &b, bool ignore_case) noexcept
Determines whether two specified xtd::basic_string objects have the same value, ignoring or honoring ...
Definition basic_string.hpp:1661
basic_string insert(xtd::size start_index, const basic_string &value) const
Inserts a specified instance of basic_string at a specified index position in this instance.
Definition basic_string.hpp:946
size_type find_first_of(const_pointer s, size_type pos) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string.hpp:702
basic_string to_upper() const noexcept
Returns a copy of the current xtd::basic_string converted to uppercase.
Definition basic_string.hpp:1391
int32 compare(size_type pos1, size_type count1, const_pointer s, size_type count2) const
Compares two character sequences.
Definition basic_string.hpp:545
basic_string trim_start(value_type trim_char) const noexcept
Removes all leading occurrences of a character specified from the specified xtd::basic_string .
xtd::size last_index_of(const basic_string &value, xtd::size start_index, xtd::size count) const
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:969
static basic_string join(const basic_string &separator, const collection_t &values, xtd::size index, xtd::size count)
Concatenates a specified separator basic_string between each element of a specified Object array,...
Definition basic_string.hpp:1727
basic_string substring(xtd::size start_index) const
Retrieves a substring from this instance. The substring starts at a specified character position and ...
Definition basic_string.hpp:1312
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...
size_type find_first_not_of(char_t ch) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:751
basic_string substr(size_type pos, size_type count) const
Returns a substring [pos, pos + count). If the requested substring extends past the end of the string...
Definition basic_string.hpp:1302
int32 compare_to(const basic_string &value) const noexcept override
Compares this instance with a specified xtd::basic_string object and indicates whether this instance ...
Definition basic_string.hpp:568
xtd::array< value_type > to_char_array() const noexcept
basic_string quoted() const
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML.
Definition basic_string.hpp:1050
static int32 compare(const basic_string &str_a, xtd::size index_a, const basic_string &str_b, xtd::size index_b, xtd::size length, xtd::string_comparison comparison_type)
Compares substrings of two specified basic_string objects using the specified rules,...
Definition basic_string.hpp:1528
basic_string< char > to_string() const noexcept override
Converts the value of this instance to a xtd::basic_string <char>.
Definition basic_string.hpp:1359
static basic_string join(const basic_string &separator, const collection_t &values, xtd::size index)
Concatenates a specified separator basic_string between each element of a specified object array,...
Definition basic_string.hpp:1717
size_type find(const_pointer s) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string.hpp:651
basic_string< xtd::wchar > to_wstring() const noexcept
Converts the value of this instance to a xtd::basic_string <xtd::wchar>.
Definition basic_string.hpp:1399
basic_string remove(xtd::size start_index) const
Deletes all the characters from this basic_string beginning at a specified position and continuing th...
Definition basic_string.hpp:1071
friend std::basic_ostream< char > & operator<<(std::basic_ostream< char > &stream, const basic_string &str)
Output stream operator. Behaves as a FormattedOutputFunction. After constructing and checking the sen...
Definition basic_string.hpp:2987
size_type find_last_not_of(char_t ch) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:839
basic_string remove(xtd::size start_index, xtd::size count) const
Deletes all the characters from this basic_string beginning at a specified position and continuing th...
Definition basic_string.hpp:1076
xtd::size last_index_of(value_type value) const noexcept
Reports the index of the last occurrence of the specified character in this tring.
Definition basic_string.hpp:977
static basic_string class_name()
Gets the class name of the object_t.
Definition basic_string.hpp:3046
static basic_string class_name(const std::type_info &info)
Gets the class name of the specified object.
Definition basic_string.hpp:3059
size_type find_last_not_of(const_pointer s) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:827
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::...
static bool equals(const basic_string &a, const basic_string &b) noexcept
Determines whether two specified xtd::basic_string objects have the same value.
Definition basic_string.hpp:1646
bool is_empty() const noexcept
Name Public Deprecated Methods.
Definition basic_string.hpp:3035
size_type find(value_type ch) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string.hpp:663
size_type rfind(value_type ch, size_type pos) const
Finds the last substring that is equal to the given character sequence. The search begins at pos and ...
Definition basic_string.hpp:1152
static int32 compare(const basic_string &str_a, const basic_string &str_b, bool ignore_case) noexcept
Compares two specified basic_string objects, ignoring or honoring their case, and returns an integer ...
Definition basic_string.hpp:1476
static int32 compare(const basic_string &str_a, const basic_string &str_b) noexcept
Compares two specified basic_string objects and returns an integer that indicates their relative posi...
Definition basic_string.hpp:1465
static basic_string concat(const basic_string &str_a, const basic_string &str_b, const basic_string &str_c) noexcept
Concatenates three specified instances of basic_string.
Definition basic_string.hpp:1550
basic_string quoted(value_type delimiter) const
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified...
Definition basic_string.hpp:1055
int32 compare_to(const object &value) const
Compares this instance with a specified xtd::object and indicates whether this instance precedes,...
Definition basic_string.hpp:556
basic_string pad_right(xtd::size total_width, char32 padding_char) const noexcept
Left-aligns the characters in this basic_string, padding with spaces on the right for a specified tot...
Definition basic_string.hpp:1044
static bool equals(const char_a_t *a, const char_b_t *b, bool ignore_case) noexcept
Determines whether two specified xtd::basic_string objects have the same value, ignoring or honoring ...
Definition basic_string.hpp:1669
static basic_string concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c) noexcept
Concatenates three specified instances of object.
Definition basic_string.hpp:1557
basic_string replace(const basic_string &old_string, const basic_string &new_string) const noexcept
Replaces all occurrences of a specified basic_string in this basic_string with another specified basi...
Definition basic_string.hpp:1093
xtd::size get_hash_code() const noexcept override
Returns the hash code for this basic_string.
Definition basic_string.hpp:857
bool starts_with(value_type value, bool ignore_case) const noexcept
Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic...
Definition basic_string.hpp:1258
virtual bool contains(value_type value) const noexcept
Returns a value indicating whether a specified char occurs within this basic_string.
Definition basic_string.hpp:573
size_type find_last_not_of(const basic_string &str) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:807
size_type find_first_not_of(const basic_string &str, size_type pos) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:725
bool ends_with(value_type value) const noexcept
Determines whether the end of this basic_string matches the specified character.
Definition basic_string.hpp:601
size_type rfind(value_type ch) const
Finds the last substring that is equal to the given character sequence. The search begins at xtd::bas...
Definition basic_string.hpp:1146
static basic_string concat(const basic_string &str_a, const basic_string &str_b, const basic_string &str_c, const basic_string &str_d) noexcept
Concatenates four specified instances of basic_string.
Definition basic_string.hpp:1536
xtd::size last_index_of(value_type value, xtd::size start_index, xtd::size count) const
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:991
basic_string & operator=(const basic_string< char > &str) noexcept
Copy assignment operator. Replaces the contents with a copy of the contents of str.
Definition basic_string.hpp:1852
size_type find_first_of(const_pointer s, size_type pos, size_type count) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string.hpp:689
xtd::size index_of(const basic_string &value, xtd::size start_index, xtd::size count) const
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:891
static basic_string concat(const basic_string &str_a, const basic_string &str_b) noexcept
Concatenates two specified instances of basic_string.
Definition basic_string.hpp:1562
size_type find(const basic_string &str) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string.hpp:631
basic_string trim_end() const noexcept
Removes all trailing occurrences of white-space characters from the specified xtd::basic_string.
Definition basic_string.hpp:1424
xtd::size last_index_of_any(const xtd::array< value_type > &values) const noexcept
Reports the index of the last occurrence in this instance of any character in a specified array of ch...
static bool equals(const char_a_t *a, const char_b_t *b) noexcept
Determines whether two specified xtd::basic_string objects have the same value.
Definition basic_string.hpp:1653
static int32 compare(const basic_string &str_a, xtd::size index_a, const basic_string &str_b, xtd::size index_b, xtd::size length)
Compares substrings of two specified basic_string objects and returns an integer that indicates their...
Definition basic_string.hpp:1500
xtd::size index_of(const basic_string &value) const noexcept
Reports the index of the first occurrence of the specified basic_string in this basic_string.
Definition basic_string.hpp:879
size_type find_first_not_of(char_t ch, size_type pos) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:757
bool equals(const object &obj) const noexcept override
Determines whether this instance and a specified object, which must also be a xtd::basic_string objec...
Definition basic_string.hpp:582
size_type find_first_of(char_t ch) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string.hpp:707
size_type find_first_not_of(const_pointer s) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:739
size_type find_first_not_of(const_pointer s, size_type pos, size_type count) const
Finds the first character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:733
basic_string substr(size_type pos) const
Returns a substring [pos, pos + count). If the requested substring extends past the end of the string...
Definition basic_string.hpp:1292
basic_string to_title_case() const noexcept
Converts the current basic_string to title case (except for words that are entirely in uppercase,...
basic_string replace(value_type old_char, value_type new_char) const noexcept
Replaces all occurrences of a specified char_t in this basic_string with another specified char_t.
Definition basic_string.hpp:1087
xtd::size index_of_any(const xtd::array< value_type > &values, xtd::size start_index, xtd::size count) const
Reports the index of the first occurrence in this instance of any character in a specified array of c...
bool ends_with(const basic_string &value, bool ignore_case) const noexcept
Determines whether the end of this basic_string instance matches the specified basic_string,...
Definition basic_string.hpp:618
static basic_string concat(const xtd::array< object_t > &args) noexcept
Concatenates the basic_string representations of the elements in a specified object array.
static bool is_empty(const xtd::basic_string< value_type, traits_type, allocator_type > &string) noexcept
Indicates whether the specifeid basic_string is an empty basic_string ("").
Definition basic_string.hpp:1693
basic_string & operator+=(const basic_string< char > &str)
Addition assignment operator. Appends additional characters to the string.
Definition basic_string.hpp:2139
bool equals(const basic_string &value, bool ignore_case) const noexcept
Determines whether this instance and another specified xtd::basic_string object have the same value,...
Definition basic_string.hpp:593
basic_string pad_right(xtd::size total_width) const noexcept
Left-aligns the characters in this basic_string, padding with spaces on the right for a specified tot...
Definition basic_string.hpp:1037
size_type find_last_of(const basic_string &str, size_type pos) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string.hpp:769
static basic_string full_class_name()
Definition basic_string.hpp:3066
basic_string trim_end(value_type trim_char) const noexcept
Removes all trailing occurrences of a character specified from the specified xtd::basic_string .
static basic_string concat(value_t value) noexcept
Creates the basic_string representation of a specified object.
Definition basic_string.hpp:1612
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...
static basic_string concat(const xtd::array< basic_string > &values) noexcept
Concatenates the elements of a specified basic_string array.
basic_string trim_start() const noexcept
Removes all leading occurrences of white-space characters from the specified xtd::basic_string.
Definition basic_string.hpp:1440
bool ends_with(const basic_string &value) const noexcept
Determines whether the end of this basic_string matches the specified basic_string.
Definition basic_string.hpp:613
size_type find_first_of(const_pointer s) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string.hpp:695
static basic_string full_class_name(const object_t &object)
Gets the fully qualified class name of the specified object, including the namespace of the specified...
Definition basic_string.hpp:3073
xtd::size last_index_of(const basic_string &value) const noexcept
Reports the index of the last occurrence of the specified basic_string in this basic_string.
Definition basic_string.hpp:956
basic_string pad_left(xtd::size total_width, char32 padding_char) const noexcept
Right-aligns the characters in this basic_string, padding with spaces on the left for a specified tot...
Definition basic_string.hpp:1030
bool equals(const basic_string &value) const noexcept override
Determines whether this instance and another specified xtd::basic_string object have the same value.
Definition basic_string.hpp:587
bool starts_with(value_type value) const noexcept
Definition basic_string.hpp:1252
size_type find_last_of(char_t ch) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string.hpp:795
size_type rfind(const basic_string &str, size_type pos) const
Finds the last substring that is equal to the given character sequence. The search begins at pos and ...
Definition basic_string.hpp:1120
static int32 compare(const basic_string &str_a, xtd::size index_a, const basic_string &str_b, xtd::size index_b, xtd::size length, bool ignore_case)
Compares substrings of two specified basic_string objects, ignoring or honoring their case,...
Definition basic_string.hpp:1514
basic_string trim(const xtd::array< value_type > &trim_chars) const noexcept
Removes all leading and trailing occurrences of a set of characters specified in an array from the sp...
size_type find_last_not_of(const_pointer s, size_type pos) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:834
basic_string< xtd::char8 > to_u8string() const noexcept
Converts the value of this instance to a xtd::basic_string <xtd::char8>.
Definition basic_string.hpp:1384
xtd::size last_index_of_any(const xtd::array< value_type > &values, xtd::size start_index) const
Reports the index of the last occurrence in this instance of any character in a specified array of ch...
size_type find(value_type ch, size_type pos) const
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_string.hpp:669
size_type find_last_of(const basic_string &str) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string.hpp:763
size_type find_last_of(const_pointer s, size_type pos, size_type count) const
Finds the last character equal to one of characters in the given character sequence....
Definition basic_string.hpp:777
basic_string substr() const
Returns a substring [pos, pos + count). If the requested substring extends past the end of the string...
Definition basic_string.hpp:1286
size_type find_last_not_of(const basic_string &str, size_type pos) const
Finds the last character equal to none of the characters in the given character sequence....
Definition basic_string.hpp:813
size_type find(const basic_string &str, size_type pos) const
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_string.hpp:637
xtd::size index_of(const basic_string &value, xtd::size start_index) const
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:884
friend basic_string operator+(const basic_string &lhs, const basic_string< char > &rhs)
Addition operator. Returns a string containing characters from lhs followed by the characters from rh...
Definition basic_string.hpp:2333
size_type find_first_of(char_t ch, size_type pos) const
Finds the first character equal to one of the characters in the given character sequence....
Definition basic_string.hpp:713
bool starts_with(const basic_string &value, bool ignore_case) const noexcept
Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic...
Definition basic_string.hpp:1272
basic_string quoted(value_type delimiter, value_type escape) const
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified...
Definition basic_string.hpp:1061
basic_string< xtd::char16 > to_u16string() const noexcept
Definition basic_string.hpp:1370
xtd::array< value_type > to_array() const noexcept
Copies the characters in this instance to a Unicode character array.
basic_string< xtd::char32 > to_u32string() const noexcept
Converts the value of this instance to a xtd::basic_string <xtd::char32>.
Definition basic_string.hpp:1377
const_reference operator[](xtd::size index) const
Returns a reference to the character at specified location index.
Definition basic_string.hpp:1840
xtd::size last_index_of(value_type value, xtd::size start_index) const
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:983
bool starts_with(const basic_string &value, xtd::string_comparison comparison_type) const noexcept
Determines whether the end of this basic_string matches the specified basic_string when compared usin...
Definition basic_string.hpp:1277
size_type find(const_pointer s, size_type pos, size_type count) const
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_string.hpp:645
size_type find(const_pointer s, size_type pos) const
Finds the first substring equal to the given character sequence. Search begins at pos,...
Definition basic_string.hpp:658
size_type rfind(const_pointer s, size_type pos) const
Finds the last substring that is equal to the given character sequence. The search begins at pos and ...
Definition basic_string.hpp:1141
auto count() const noexcept -> xtd::size
Definition enumerable.hpp:209
auto append(const source_t &element) const noexcept
Appends a value to the end of the sequence.
Definition enumerable.hpp:144
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:40
char_t value_type
Definition ienumerable.hpp:46
typename xtd::collections::generic::extensions::enumerable_iterators< char_t, xtd::collections::generic::ienumerable< char_t > >::const_iterator const_iterator
Definition ienumerable.hpp:50
typename xtd::collections::generic::extensions::enumerable_iterators< char_t, xtd::collections::generic::ienumerable< char_t > >::iterator iterator
Definition ienumerable.hpp:48
Supports a simple iteration over a generic collection.
Definition ienumerator.hpp:58
static xtd::size combine(args_t... values) noexcept
Combines values into a hash code.
Definition hash_code.hpp:70
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.hpp:21
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
object()=default
Create a new instance of the ultimate base class object.
Contains xtd::collections::generic::ienumerable <type_t> interface.
@ argument
The argument is not valid.
Definition exception_case.hpp:31
@ index_out_of_range
The index is out of range.
Definition exception_case.hpp:61
@ argument_out_of_range
The argument is out of range.
Definition exception_case.hpp:35
@ null_pointer
The pointer is null.
Definition exception_case.hpp:79
@ invalid_operation
The operation is not valid.
Definition exception_case.hpp:65
#define self_
The self_ expression is a reference value expression whose value is the reference of the implicit obj...
Definition self.hpp:20
constexpr xtd::size npos
Represents a value that is not a valid position in a collection.
Definition npos.hpp:26
constexpr xtd::size epos
Represents the index of the last valid element in a collection.
Definition epos.hpp:33
constexpr xtd::size bpos
Represents the index of the firsy valid element in a collection.
Definition bpos.hpp:25
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:26
null_ptr null
Represents a null pointer value.
wchar_t wchar
Represents a wide character.
Definition wchar.hpp:24
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:23
string_comparison
Specifies the culture, case, and sort rules to be used by certain overloads of the xtd::string::compa...
Definition string_comparison.hpp:14
string_split_options
Specifies whether applicable xtd::string::split method overloads include or omit empty substrings fro...
Definition string_split_options.hpp:14
ptr< type_t > new_ptr(args_t &&... args)
The xtd::new_ptr operator creates a xtd::ptr object.
Definition new_ptr.hpp:24
value_t parse(const std::string &str)
Convert a string into a type.
Definition parse.hpp:34
@ ordinal
Compare strings using ordinal (binary) sort rules.
Definition string_comparison.hpp:24
@ ordinal_ignore_case
Compare strings using ordinal (binary) sort rules and ignoring the case of the strings being compared...
Definition string_comparison.hpp:26
@ s
The S key.
Definition console_key.hpp:124
@ a
The A key.
Definition console_key.hpp:88
@ c
The C key.
Definition console_key.hpp:92
@ i
The I key.
Definition console_key.hpp:104
@ b
The B key.
Definition console_key.hpp:90
@ separator
The Separator key.
Definition console_key.hpp:172
@ escape
The ESC (ESCAPE) key.
Definition console_key.hpp:34
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 abstract_object.hpp:8
read_only_span< type_t, count > first() const
Obtains a subspan consisting of the first count elements of the sequence.
Definition read_only_span.hpp:282
read_only_span< type_t, count > last() const
Obtains a subspan consisting of the last N elements of the sequence.
Definition read_only_span.hpp:307
constexpr size_type length() const noexcept
Returns the length of the current read_only_span.
Definition read_only_span.hpp:229
constexpr const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Contains xtd::null pointer valiue.
Contains xtd::object class.
Contains xtd::parse methods.
Contains xtd::string_comparison enum class.
Contains xtd::string_split_options enum class.
Supports a simple iteration over a generic collection.
Definition enumerator.hpp:38
Contains xtd fundamental types.
Contains unused_ keyword.