6#define __XTD_CORE_INTERNAL__
11#undef __XTD_CORE_INTERNAL__
12#define __XTD_STD_INTERNAL__
14#undef __XTD_STD_INTERNAL__
36template<
typename ...args_t>
38template<
typename target_t,
typename source_t>
39std::basic_string<target_t> __xtd_convert_to_string(std::basic_string<source_t>&& str)
noexcept;
40template<
typename target_t,
typename source_t>
41std::basic_string<target_t> __xtd_convert_to_string(
const std::basic_string<source_t>& str)
noexcept;
42std::basic_string<char> __xtd_demangle(
const std::basic_string<char>& value)
noexcept;
43std::basic_string<char> __xtd_get_class_name(
const std::type_info& value)
noexcept;
44std::basic_string<char> __xtd_get_full_class_name(
const std::type_info& value)
noexcept;
72 template<
typename char_t,
typename traits_t,
typename allocator_t>
80 using base_type = std::basic_string<char_t, traits_t, allocator_t>;
96 using pointer =
typename base_type::pointer;
141 basic_string(std::basic_string<char_t>&& str) : chars_ {std::move(str)} {}
145 if constexpr(std::is_same_v<char, char_t>) chars_ = str.chars_;
146 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
151 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ = str.chars_;
152 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
157 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ = str.chars_;
158 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
163 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ = str.chars_;
164 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
169 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ = str.chars_;
170 else chars_ = __xtd_convert_to_string<value_type>(str.chars_);
175 if constexpr(std::is_same_v<char, char_t>) chars_ = str;
176 else chars_ = __xtd_convert_to_string<value_type>(str);
181 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ = str;
182 else chars_ = __xtd_convert_to_string<value_type>(str);
187 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ = str;
188 else chars_ = __xtd_convert_to_string<value_type>(str);
193 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ = str;
194 else chars_ = __xtd_convert_to_string<value_type>(str);
199 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ = str;
200 else chars_ = __xtd_convert_to_string<value_type>(str);
226 if constexpr(std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str);
227 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str));
233 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str);
234 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str));
240 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str);
241 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str));
247 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str);
248 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str));
254 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str);
255 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
262 if constexpr(std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str,
count);
263 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str,
count));
269 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str,
count);
270 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str,
count));
276 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str,
count);
277 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str,
count));
283 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str,
count);
284 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str,
count));
290 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str,
count);
291 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str,
count));
296 template<
typename input_iterator_t>
347 [[nodiscard]]
virtual auto count() const noexcept ->
size_type {
return chars_.size();}
360 [[nodiscard]]
virtual auto empty() const noexcept ->
bool {
return length() == 0;}
365 [[nodiscard]]
virtual auto length() const noexcept ->
size_type {
return chars_.size();}
370 [[nodiscard]]
virtual auto size() const noexcept ->
size_type {
return chars_.size();}
423 if (ignore_case)
return to_upper().chars_ == value.to_upper().chars_;
424 return chars_ == value.chars_;
437 return chars_.rfind(value) ==
length() - 1;
454 return chars_.rfind(value) + value.length() ==
length();
468 [[nodiscard]]
const value_type& current()
const override {
470 return chars_[index_];
472 bool move_next()
override {
return ++index_ < chars_.length();}
499 auto result = chars_.find(value, start_index);
500 return result > start_index +
count ?
npos : result;
519 auto result = chars_.find(value, start_index);
520 return result > start_index +
count ?
npos : result;
541 [[nodiscard]]
auto index_of_any(
const std::initializer_list<value_type>& values)
const noexcept ->
xtd::usize;
555 result.chars_.insert(start_index, value);
577 auto result = chars_.rfind(value, start_index +
count - value.length());
578 return result < start_index ?
npos : result;
599 auto result = chars_.rfind(value, start_index +
count - 1);
600 return result < start_index ?
npos : result;
668 std::wstringstream ss;
669 if constexpr(std::is_same_v<xtd::wchar, value_type>) ss << std::quoted(chars_, delimiter,
escape);
670 else ss << std::quoted(__xtd_convert_to_string<xtd::wchar>(chars_),
static_cast<xtd::wchar>(delimiter),
static_cast<xtd::wchar>(
escape));
685 result.chars_.erase(start_index,
count);
701 auto old_size = old_string.length();
702 auto new_size = new_string.length();
705 index = result.chars_.find(old_string,
index);
707 if (old_size == new_size) result.chars_.replace(
index, old_size, new_string);
709 result.chars_.erase(
index, old_string.length());
710 result.chars_.insert(
index, new_string);
712 index += new_string.length();
822 if (ignore_case)
return to_lower().chars_.find(
static_cast<value_type>(tolower(value))) == 0;
823 return chars_.find(value) == 0;
842 return chars_.find(value) == 0;
852 return chars_.substr(start_index);
861 return chars_.substr(start_index,
length);
890 std::for_each(chars_.begin(), chars_.end(), [&](
auto c) {result += static_cast<value_type>(std::tolower(c));});
898 if constexpr(std::is_same_v<char, char_t>)
return chars_;
899 else return __xtd_convert_to_string<char>(chars_);
909 if constexpr(std::is_same_v<xtd::char16, char_t>)
return chars_;
910 else return __xtd_convert_to_string<xtd::char16>(chars_);
916 if constexpr(std::is_same_v<xtd::char32, char_t>)
return chars_;
917 else return __xtd_convert_to_string<xtd::char32>(chars_);
923 if constexpr(std::is_same_v<xtd::char8, char_t>)
return chars_;
924 else return __xtd_convert_to_string<xtd::char8>(chars_);
931 std::for_each(chars_.begin(), chars_.end(), [&](
auto c) {result += static_cast<value_type>(std::toupper(c));});
938 if constexpr(std::is_same_v<xtd::wchar, char_t>)
return chars_;
939 else return __xtd_convert_to_string<xtd::wchar>(chars_);
1052 [[nodiscard]]
static auto compare(
const basic_string& str_a,
xtd::usize index_a,
const basic_string& str_b,
xtd::usize index_b,
xtd::usize length,
bool ignore_case) ->
xtd::int32 {
return compare(str_a, index_a, str_b, index_b,
length, ignore_case ?
xtd::string_comparison::ordinal_ignore_case :
xtd::string_comparison::ordinal);}
1081 template<
typename object_a_t,
typename object_b_t,
typename object_c_t,
typename object_d_t>
1082 [[nodiscard]]
static auto concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c, object_d_t obj_d)
noexcept ->
basic_string {
return format(
"{}{}{}{}", obj_a, obj_b, obj_c, obj_d);}
1094 template<
typename object_a_t,
typename object_b_t,
typename object_c_t>
1095 [[nodiscard]]
static auto concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c)
noexcept ->
basic_string {
return format(
"{}{}{}", obj_a, obj_b, obj_c);}
1105 template<
typename object_a_t,
typename object_b_t>
1113 template<
typename other_
char_t>
1115 [[nodiscard]]
static auto concat(
const std::initializer_list<basic_string>& values)
noexcept ->
basic_string {
1117 std::for_each(values.begin(), values.end(), [&](
const auto& item) {result += item;});
1120 [[nodiscard]]
static auto concat(
const std::initializer_list<const_pointer>& values)
noexcept ->
basic_string {
1122 std::for_each(values.begin(), values.end(), [&](
const auto& item) {result += item;});
1125 template<
typename other_
char_t>
1126 [[nodiscard]]
static auto concat(
const std::initializer_list<const other_char_t*>& values)
noexcept ->
basic_string {
1128 std::for_each(values.begin(), values.end(), [&](
const auto& item) {result += item;});
1135 template<
typename object_t>
1138 template<
typename object_t>
1139 [[nodiscard]]
static auto concat(
const std::initializer_list<object_t>& args)
noexcept ->
basic_string {
1141 for (
const auto& arg : args)
1142 result +=
format(
"{}", arg);
1149 template<
typename value_t>
1151 return format(
"{}", value);
1175 if constexpr(std::is_same_v<char, char_t>)
return __xtd_demangle(name.chars());
1176 else return __xtd_demangle(__xtd_convert_to_string<char>(name.chars()));
1190 template<
typename char_a_t,
typename char_b_t>
1206 template<
typename char_a_t,
typename char_b_t>
1215 template<
typename ...args_t>
1225 template<
typename ...args_t>
1239 template<
typename collection_t>
1243 for (
const auto& item : values)
1254 template<
typename collection_t>
1264 template<
typename collection_t>
1269 for (
const auto& item : values) {
1277 template<
typename value_t>
1279 template<
typename value_t>
1281 template<
typename value_t>
1288 template<
typename value_t>
1353 template<
typename ...args_t>
1354 [[nodiscard]]
static auto sprintf(
const basic_string& fmt, args_t&& ... args)
noexcept ->
basic_string {
return __sprintf(fmt.chars().c_str(), convert_param(std::forward<args_t>(args)) ...);}
1360 template<
typename value_t>
1380 return chars_[
index];
1411 operator const base_type& ()
const noexcept {
return chars_;}
1417 if constexpr(std::is_same<char_t, char>::value) chars_ = str.chars_;
1418 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
1425 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = str.chars_;
1426 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
1433 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = str.chars_;
1434 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
1441 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = str.chars_;
1442 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
1449 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = str.chars_;
1450 else chars_ = __xtd_convert_to_string<value_type>(str.chars());
1458 if constexpr(std::is_same<char_t, char>::value) chars_ = std::move(str.chars_);
1459 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
1466 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = std::move(str.chars_);
1467 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
1474 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = std::move(str.chars_);
1475 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
1482 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = std::move(str.chars_);
1483 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
1490 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = std::move(str.chars_);
1491 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str.chars_)));
1499 if constexpr(std::is_same<char_t, char>::value) chars_ = str;
1500 else chars_ = __xtd_convert_to_string<value_type>(str);
1507 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = str;
1508 else chars_ = __xtd_convert_to_string<value_type>(str);
1515 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = str;
1516 else chars_ = __xtd_convert_to_string<value_type>(str);
1523 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = str;
1524 else chars_ = __xtd_convert_to_string<value_type>(str);
1531 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = str;
1532 else chars_ = __xtd_convert_to_string<value_type>(str);
1540 if constexpr(std::is_same<char_t, char>::value) chars_ = std::move(str);
1541 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
1548 if constexpr(std::is_same<char_t, xtd::char16>::value) chars_ = std::move(str);
1549 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
1556 if constexpr(std::is_same<char_t, xtd::char32>::value) chars_ = std::move(str);
1557 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
1564 if constexpr(std::is_same<char_t, xtd::char8>::value) chars_ = std::move(str);
1565 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
1572 if constexpr(std::is_same<char_t, xtd::wchar>::value) chars_ = std::move(str);
1573 else chars_ = std::move(__xtd_convert_to_string<value_type>(std::move(str)));
1583 if constexpr(std::is_same_v<char, char_t>) chars_ = std::basic_string<char>(str);
1584 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<char>(str));
1593 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ = std::basic_string<xtd::char16>(str);
1594 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char16>(str));
1603 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ = std::basic_string<xtd::char32>(str);
1604 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char32>(str));
1613 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ = std::basic_string<xtd::char8>(str);
1614 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::char8>(str));
1623 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ = std::basic_string<xtd::wchar>(str);
1624 else chars_ = __xtd_convert_to_string<value_type>(std::basic_string<xtd::wchar>(str));
1704 if constexpr(std::is_same_v<char, char_t>) chars_ += str.chars_;
1705 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
1712 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ += str.chars_;
1713 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
1720 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ += str.chars_;
1721 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
1728 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ += str.chars_;
1729 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
1736 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ += str.chars_;
1737 else chars_ += __xtd_convert_to_string<value_type>(str.chars_);
1745 if constexpr(std::is_same_v<char, char_t>) chars_ += std::move(str.chars_);
1746 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
1753 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ += std::move(str.chars_);
1754 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
1761 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ += std::move(str.chars_);
1762 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
1769 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ += std::move(str.chars_);
1770 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
1777 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ += std::move(str.chars_);
1778 else chars_ += __xtd_convert_to_string<value_type>(std::move(str.chars_));
1786 if constexpr(std::is_same_v<char, char_t>) chars_ += str;
1787 else chars_ += __xtd_convert_to_string<value_type>(str);
1794 if constexpr(std::is_same_v<xtd::char16, char_t>) chars_ += str;
1795 else chars_ += __xtd_convert_to_string<value_type>(str);
1802 if constexpr(std::is_same_v<xtd::char32, char_t>) chars_ += str;
1803 else chars_ += __xtd_convert_to_string<value_type>(str);
1810 if constexpr(std::is_same_v<xtd::char8, char_t>) chars_ += str;
1811 else chars_ += __xtd_convert_to_string<value_type>(str);
1818 if constexpr(std::is_same_v<xtd::wchar, char_t>) chars_ += str;
1819 else chars_ += __xtd_convert_to_string<value_type>(str);
1944 auto result = std::move(lhs);
1945 result += std::move(rhs);
1953 auto result = std::move(lhs);
1954 result += std::move(rhs);
1962 auto result = std::move(lhs);
1963 result += std::move(rhs);
1971 auto result = std::move(lhs);
1972 result += std::move(rhs);
1980 auto result = std::move(lhs);
1981 result += std::move(rhs);
1990 auto result = std::move(lhs);
1999 auto result = std::move(lhs);
2008 auto result = std::move(lhs);
2017 auto result = std::move(lhs);
2026 auto result = std::move(lhs);
2037 result += std::move(rhs);
2046 result += std::move(rhs);
2055 result += std::move(rhs);
2064 result += std::move(rhs);
2073 result += std::move(rhs);
2129 if constexpr(std::is_same_v<char, char_t>) result += rhs.chars();
2130 else result += __xtd_convert_to_string<char>(rhs.chars());
2139 if constexpr(std::is_same_v<xtd::char16, char_t>) result += rhs.chars();
2140 else result += __xtd_convert_to_string<xtd::char16>(rhs.chars());
2149 if constexpr(std::is_same_v<xtd::char32, char_t>) result += rhs.chars();
2150 else result += __xtd_convert_to_string<xtd::char32>(rhs.chars());
2159 if constexpr(std::is_same_v<xtd::char8, char_t>) result += rhs.chars();
2160 else result += __xtd_convert_to_string<xtd::char8>(rhs.chars());
2169 if constexpr(std::is_same_v<xtd::wchar, char_t>) result += rhs.chars();
2170 else result += __xtd_convert_to_string<xtd::wchar>(rhs.chars());
2225 auto result = std::move(lhs);
2234 auto result = std::move(lhs);
2243 auto result = std::move(lhs);
2252 auto result = std::move(lhs);
2261 auto result = std::move(lhs);
2318 result += std::move(rhs);
2327 result += std::move(rhs);
2336 result += std::move(rhs);
2345 result += std::move(rhs);
2354 result += std::move(rhs);
2409 auto result = std::move(lhs);
2418 auto result = std::move(lhs);
2427 auto result = std::move(lhs);
2436 auto result = std::move(lhs);
2445 auto result = std::move(lhs);
2502 result += std::move(rhs);
2511 result += std::move(rhs);
2520 result += std::move(rhs);
2529 result += std::move(rhs);
2538 result += std::move(rhs);
2552 if constexpr(std::is_same_v<char, char_t>)
return stream << str.chars();
2553 else return stream << __xtd_convert_to_string<char>(str.chars());
2561 friend auto operator <<(std::basic_ostream<xtd::wchar>& stream,
const basic_string& str) -> std::basic_ostream<xtd::wchar>& {
return stream << str.to_wstring().chars();}
2572 auto s = std::basic_string<char> {};
2586 auto s = std::basic_string<xtd::wchar> {};
2598 [[deprecated(
"Replaced by xtd::basic_string::is_empty(const xtd::basic_string&) - Will be removed in version 1.2.0.")]]
2608 template<
typename object_t>
2609 [[deprecated(
"Replaced by typeof_<object_t>().name() - Will be removed in version 1.2.0.")]]
2615 template<
typename object_t>
2616 [[deprecated(
"Replaced by typeof_(object).name() - Will be removed in version 1.2.0.")]]
2622 [[deprecated(
"Replaced by typeof_(info).name() - Will be removed in version 1.2.0.")]]
2628 template<
typename object_t>
2629 [[deprecated(
"Replaced by typeof_<object_t>().full_name() - Will be removed in version 1.2.0.")]]
2635 template<
typename object_t>
2636 [[deprecated(
"Replaced by typeof_(object).full_name() - Will be removed in version 1.2.0.")]]
2642 [[deprecated(
"Replaced by typeof_(info).full_name() - Will be removed in version 1.2.0.")]]
2653 static const
xtd::array<value_type> default_split_separators;
2654 static const
xtd::array<value_type> default_trim_chars;
2656 template<typename arg_t>
2657 [[nodiscard]] static auto convert_param(arg_t&& arg) noexcept {
2658 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();
2659 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();
2660 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();
2661 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();
2662 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();
2663 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();
2664 else return std::forward<arg_t>(arg);
2668 auto length = full_name.last_index_of(
"<");
2670 if (full_name.last_index_of(
"::", 0,
length) ==
npos)
return full_name;
2671 return full_name.substring(full_name.last_index_of(
"::", 0,
length) + 2);
2678#define __XTD_BASIC_STRING_INTERNAL__
2680#undef __XTD_BASIC_STRING_INTERNAL__
2684 template<
typename char_t>
2685 struct hash<xtd::basic_string<char_t>> {
2686 auto operator()(
const xtd::basic_string<char_t>& s)
const noexcept ->
xtd::usize {
return s.get_hash_code();}
Contains xtd::basic_read_only_string_view alias.
Contains xtd::basic_string class.
Contains xtd::basic_string_view alias.
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:73
basic_string(const basic_string< xtd::char32 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:156
std::basic_string< char_t, traits_t, allocator_t > base_type
Represents the basic string base type.
Definition basic_string.hpp:80
auto remove(xtd::usize start_index, xtd::usize count) const -> basic_string
Deletes all the characters from this basic_string beginning at a specified position and continuing th...
Definition basic_string.hpp:682
static auto parse(const basic_string &str) -> value_t
Converts a basic_string into a value_t type.
Definition basic_string.hpp:1289
auto last_index_of(const basic_string &value) const noexcept -> xtd::usize
Reports the index of the last occurrence of the specified basic_string in this basic_string.
Definition basic_string.hpp:562
auto trim_end(value_type trim_char) const noexcept -> basic_string
Removes all trailing occurrences of a character specified from the specified xtd::basic_string .
auto substring(xtd::usize start_index) const -> basic_string
Retrieves a substring from this instance. The substring starts at a specified character position and ...
Definition basic_string.hpp:850
auto trim(const xtd::array< value_type > &trim_chars) const noexcept -> basic_string
Removes all leading and trailing occurrences of a set of characters specified in an array from the sp...
auto replace(const basic_string &old_string, const basic_string &new_string) const noexcept -> basic_string
Replaces all occurrences of a specified basic_string in this basic_string with another specified basi...
Definition basic_string.hpp:699
auto quoted(value_type delimiter, value_type escape) const -> basic_string
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified...
Definition basic_string.hpp:667
static auto concat(object_a_t obj_a, object_b_t obj_b) noexcept -> basic_string
Concatenates two specified instances of object.
Definition basic_string.hpp:1106
static auto class_name() -> basic_string
Gets the class name of the object_t.
Definition basic_string.hpp:2610
auto compare_to(const object &value) const -> xtd::int32
Compares this instance with a specified xtd::object and indicates whether this instance precedes,...
Definition basic_string.hpp:385
static auto compare(const basic_string &str_a, xtd::usize index_a, const basic_string &str_b, xtd::usize index_b, xtd::usize length) -> xtd::int32
Compares substrings of two specified basic_string objects and returns an integer that indicates their...
Definition basic_string.hpp:1038
auto to_u32string() const noexcept -> basic_string< xtd::char32 >
Converts the value of this instance to a xtd::basic_string <xtd::char32>.
Definition basic_string.hpp:915
static const basic_string empty_string
Definition basic_string.hpp:118
auto chars() noexcept -> base_type &
Returns a reference to the underlying base type.
Definition basic_string.hpp:342
auto operator=(const basic_string< char > &str) noexcept -> basic_string &
Copy assignment operator. Replaces the contents with a copy of the contents of str.
Definition basic_string.hpp:1416
static auto equals(const basic_string &a, const basic_string &b) noexcept -> bool
Determines whether two specified xtd::basic_string objects have the same value.
Definition basic_string.hpp:1184
auto to_array() const noexcept -> xtd::array< value_type >
Copies the characters in this instance to a Unicode character array.
friend auto operator<<(std::basic_ostream< char > &stream, const basic_string &str) -> std::basic_ostream< char > &
Output stream operator. Behaves as a FormattedOutputFunction. After constructing and checking the sen...
Definition basic_string.hpp:2551
basic_string(xtd::wchar character, xtd::usize count)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:221
basic_string(const xtd::char32 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:238
auto to_u16string() const noexcept -> basic_string< xtd::char16 >
Definition basic_string.hpp:908
typename base_type::allocator_type allocator_type
Represents the basic string allocator type.
Definition basic_string.hpp:86
auto index_of(value_type value) const noexcept -> xtd::usize
Reports the index of the first occurrence of the specified character in this basic_string.
Definition basic_string.hpp:505
basic_string(const xtd::wchar *str, xtd::usize count)
Initializes a new instance of xtd::basic_string with specified substring and count characters.
Definition basic_string.hpp:288
auto trim_start(const xtd::array< value_type > &trim_chars) const noexcept -> basic_string
Removes all leading occurrences of a set of characters specified in an array from the specified xtd::...
auto to_upper() const noexcept -> basic_string
Returns a copy of the current xtd::basic_string converted to uppercase.
Definition basic_string.hpp:929
static auto compare(const basic_string &str_a, const basic_string &str_b) noexcept -> xtd::int32
Compares two specified basic_string objects and returns an integer that indicates their relative posi...
Definition basic_string.hpp:1003
basic_string(const xtd::basic_string_view< char_t > &str)
Initializes a new instance of xtd::basic_string with specified xtd::basic_string_view.
Definition basic_string.hpp:303
static auto full_class_name() -> basic_string
Definition basic_string.hpp:2630
virtual auto contains(const basic_string &value) const noexcept -> bool
Returns a value indicating whether a specified substring occurs within this basic_string.
Definition basic_string.hpp:406
auto starts_with(const basic_string &value, bool ignore_case) const noexcept -> bool
Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic...
Definition basic_string.hpp:835
friend auto operator+(const basic_string &lhs, const basic_string< char > &rhs) -> basic_string
Addition operator. Returns a string containing characters from lhs followed by the characters from rh...
Definition basic_string.hpp:1897
typename xtd::collections::generic::enumerator< value_type > enumerator_type
Represents the basic string enumerator type.
Definition basic_string.hpp:110
auto quoted(value_type delimiter) const -> basic_string
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML ith specified...
Definition basic_string.hpp:661
basic_string(const basic_string< xtd::char8 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:162
static auto join(const basic_string &separator, const collection_t &values) noexcept -> basic_string
Concatenates a specified separator basic_string between each element of a specified object array,...
Definition basic_string.hpp:1240
static auto join(const basic_string &separator, const collection_t &values, xtd::usize index) -> basic_string
Concatenates a specified separator basic_string between each element of a specified object array,...
Definition basic_string.hpp:1255
auto trim_end(const xtd::array< value_type > &trim_chars) const noexcept -> basic_string
Removes all trailing occurrences of a set of characters specified in an array from the specified xtd:...
auto equals(const basic_string &value, bool ignore_case) const noexcept -> bool
Determines whether this instance and another specified xtd::basic_string object have the same value,...
Definition basic_string.hpp:422
auto compare_to(const basic_string &value) const noexcept -> xtd::int32 override
Compares this instance with a specified xtd::basic_string object and indicates whether this instance ...
Definition basic_string.hpp:397
basic_string(input_iterator_t first, input_iterator_t last)
Initializes a new instance of xtd::basic_string with specified first and last iterators of substring.
Definition basic_string.hpp:297
auto starts_with(const basic_string &value, xtd::string_comparison comparison_type) const noexcept -> bool
Determines whether the end of this basic_string matches the specified basic_string when compared usin...
Definition basic_string.hpp:840
auto last_index_of_any(const xtd::array< value_type > &values, xtd::usize start_index) const -> xtd::usize
Reports the index of the last occurrence in this instance of any character in a specified array of ch...
typename base_type::const_pointer const_pointer
Represents the basic string const pointer type.
Definition basic_string.hpp:98
basic_string(std::initializer_list< xtd::wchar > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.hpp:321
friend auto operator>>(std::basic_istream< char > &stream, basic_string &str) -> std::basic_istream< char > &
Input stream operator. Behaves as a FormattedInputFunction. After constructing and checking the sentr...
Definition basic_string.hpp:2571
auto trim(value_type trim_char) const noexcept -> basic_string
Removes all leading and trailing occurrences of a character specified from the specified xtd::basic_s...
basic_string(const xtd::char32 *str, xtd::usize count)
Initializes a new instance of xtd::basic_string with specified substring and count characters.
Definition basic_string.hpp:274
auto operator[](xtd::usize index) const -> const_reference
Returns a reference to the character at specified location index.
Definition basic_string.hpp:1378
basic_string(const basic_string< xtd::char16 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:150
auto substring(xtd::usize start_index, xtd::usize length) const -> basic_string
Retrieves a substring from this instance. The substring starts at a specified character position and ...
Definition basic_string.hpp:859
basic_string(const std::basic_string< char > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:174
virtual auto length() const noexcept -> size_type
Gets the number of characters in the current xtd::basic_string object.
Definition basic_string.hpp:365
typename base_type::traits_type traits_type
Represents the basic string traits type.
Definition basic_string.hpp:82
virtual auto get_base_type() const noexcept -> const base_type &
Returns the underlying base type.
Definition basic_string.hpp:459
static auto compare(const basic_string &str_a, xtd::usize index_a, const basic_string &str_b, xtd::usize index_b, xtd::usize length, xtd::string_comparison comparison_type) -> xtd::int32
Compares substrings of two specified basic_string objects using the specified rules,...
Definition basic_string.hpp:1066
typename base_type::pointer pointer
Represents the basic string pointer type.
Definition basic_string.hpp:96
typename base_type::const_reference const_reference
Represents the basic string const referecne type.
Definition basic_string.hpp:94
basic_string(std::initializer_list< xtd::char32 > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.hpp:315
auto ends_with(const basic_string &value) const noexcept -> bool
Determines whether the end of this basic_string matches the specified basic_string.
Definition basic_string.hpp:442
basic_string(const std::basic_string< xtd::char16 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:180
auto last_index_of_any(const xtd::array< value_type > &values, xtd::usize start_index, xtd::usize count) const -> xtd::usize
Reports the index of the last occurrence in this instance of any character in a specified array of ch...
auto to_u8string() const noexcept -> basic_string< xtd::char8 >
Converts the value of this instance to a xtd::basic_string <xtd::char8>.
Definition basic_string.hpp:922
virtual auto contains(value_type value) const noexcept -> bool
Returns a value indicating whether a specified char occurs within this basic_string.
Definition basic_string.hpp:402
static auto concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c, object_d_t obj_d) noexcept -> basic_string
Concatenates four specified instances of object.
Definition basic_string.hpp:1082
auto pad_right(xtd::usize total_width) const noexcept -> basic_string
Left-aligns the characters in this basic_string, padding with spaces on the right for a specified tot...
Definition basic_string.hpp:643
static auto compare(const basic_string &str_a, xtd::usize index_a, const basic_string &str_b, xtd::usize index_b, xtd::usize length, bool ignore_case) -> xtd::int32
Compares substrings of two specified basic_string objects, ignoring or honoring their case,...
Definition basic_string.hpp:1052
auto to_lower() const noexcept -> basic_string
Returns a copy of the current xtd::basic_string converted to lowercase.
Definition basic_string.hpp:888
auto pad_right(xtd::usize total_width, char32 padding_char) const noexcept -> basic_string
Left-aligns the characters in this basic_string, padding with spaces on the right for a specified tot...
Definition basic_string.hpp:650
basic_string(const char *str, xtd::usize count)
Initializes a new instance of xtd::basic_string with specified substring and count characters.
Definition basic_string.hpp:260
basic_string(const basic_string< xtd::wchar > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:168
static auto concat(const xtd::array< basic_string > &values) noexcept -> basic_string
Concatenates the elements of a specified basic_string array.
basic_string(xtd::char8 character, xtd::usize count)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:217
static auto full_class_name(const object_t &object) -> basic_string
Gets the fully qualified class name of the specified object, including the namespace of the specified...
Definition basic_string.hpp:2637
static auto compare(const basic_string &str_a, const basic_string &str_b, xtd::string_comparison comparison_type) noexcept -> xtd::int32
Compares two specified basic_string objects using the specified rules, and returns an integer that in...
Definition basic_string.hpp:1025
auto index_of(value_type value, xtd::usize start_index) const -> xtd::usize
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:510
typename xtd::collections::generic::ienumerable< char_t >::iterator iterator
Represents the basic string iterator type.
Definition basic_string.hpp:101
typename base_type::const_reverse_iterator const_reverse_iterator
Represents the basic string const reverse iterator type.
Definition basic_string.hpp:108
static auto concat(const basic_string &str_a, const basic_string &str_b, const basic_string &str_c, const basic_string &str_d) noexcept -> basic_string
Concatenates four specified instances of basic_string.
Definition basic_string.hpp:1074
auto index_of(const basic_string &value, xtd::usize start_index) const -> xtd::usize
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:490
basic_string(const char *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:224
auto last_index_of(value_type value) const noexcept -> xtd::usize
Reports the index of the last occurrence of the specified character in this tring.
Definition basic_string.hpp:583
auto to_wstring() const noexcept -> basic_string< xtd::wchar >
Converts the value of this instance to a xtd::basic_string <xtd::wchar>.
Definition basic_string.hpp:937
auto c_str() const noexcept -> const_pointer
Returns a pointer to a null-terminated character array with data equivalent to those stored in the st...
Definition basic_string.hpp:335
basic_string(const xtd::char16 *str, xtd::usize count)
Initializes a new instance of xtd::basic_string with specified substring and count characters.
Definition basic_string.hpp:267
basic_string(std::initializer_list< char > il)
Initializes a new instance of xtd::basic_string with specified xtd::basic_string_view.
Definition basic_string.hpp:309
auto to_title_case() const noexcept -> basic_string
Converts the current basic_string to title case (except for words that are entirely in uppercase,...
static auto concat(const basic_string &str_a, const basic_string &str_b, const basic_string &str_c) noexcept -> basic_string
Concatenates three specified instances of basic_string.
Definition basic_string.hpp:1088
static auto join(const basic_string &separator, const collection_t &values, xtd::usize index, xtd::usize count) -> basic_string
Concatenates a specified separator basic_string between each element of a specified Object array,...
Definition basic_string.hpp:1265
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:821
typename base_type::size_type size_type
Represents the basic string size type.
Definition basic_string.hpp:88
auto last_index_of(const basic_string &value, xtd::usize start_index) const -> xtd::usize
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:568
auto ends_with(const basic_string &value, bool ignore_case) const noexcept -> bool
Determines whether the end of this basic_string instance matches the specified basic_string,...
Definition basic_string.hpp:447
static auto try_parse(const basic_string &str, value_t &value) noexcept -> bool
Try to convert a basic_string into a value_t type.
Definition basic_string.hpp:1361
basic_string(const xtd::wchar *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:252
auto replace(value_type old_char, value_type new_char) const noexcept -> basic_string
Replaces all occurrences of a specified char_t in this basic_string with another specified char_t.
Definition basic_string.hpp:693
auto trim_start() const noexcept -> basic_string
Removes all leading occurrences of white-space characters from the specified xtd::basic_string.
Definition basic_string.hpp:978
auto last_index_of(value_type value, xtd::usize start_index, xtd::usize count) const -> xtd::usize
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:597
auto equals(const object &obj) const noexcept -> bool override
Determines whether this instance and a specified object, which must also be a xtd::basic_string objec...
Definition basic_string.hpp:411
basic_string(basic_string &&)=default
Initializes a new instance of xtd::basic_string with specified string to move.
static constexpr size_type npos
Definition basic_string.hpp:128
auto trim_start(value_type trim_char) const noexcept -> basic_string
Removes all leading occurrences of a character specified from the specified xtd::basic_string .
basic_string(xtd::char16 character, xtd::usize count)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:209
virtual auto empty() const noexcept -> bool
Checks whether the container is empty.
Definition basic_string.hpp:360
static auto equals(const char_a_t *a, const char_b_t *b, bool ignore_case) noexcept -> bool
Determines whether two specified xtd::basic_string objects have the same value, ignoring or honoring ...
Definition basic_string.hpp:1207
basic_string(xtd::char32 character, xtd::usize count)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:213
basic_string(const basic_string< char > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:144
static auto concat(const xtd::array< object_t > &args) noexcept -> basic_string
Concatenates the basic_string representations of the elements in a specified object array.
static auto full_class_name(const std::type_info &info) -> basic_string
Gets the fully qualified class name of the specified object, including the namespace of the specified...
Definition basic_string.hpp:2643
auto operator+=(const basic_string< char > &str) -> basic_string &
Addition assignment operator. Appends additional characters to the string.
Definition basic_string.hpp:1703
basic_string(const xtd::char8 *str, xtd::usize count)
Initializes a new instance of xtd::basic_string with specified substring and count characters.
Definition basic_string.hpp:281
static auto class_name(const std::type_info &info) -> basic_string
Gets the class name of the specified object.
Definition basic_string.hpp:2623
static auto concat(value_t value) noexcept -> basic_string
Creates the basic_string representation of a specified object.
Definition basic_string.hpp:1150
auto last_index_of(const basic_string &value, xtd::usize start_index, xtd::usize count) const -> xtd::usize
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:575
auto trim() const noexcept -> basic_string
Removes all leading and trailing occurrences of white-space characters from the specified xtd::basic_...
Definition basic_string.hpp:946
auto ends_with(value_type value, bool ignore_case) const noexcept -> bool
Determines whether the end of this basic_string matches the specified character, ignoring or honoring...
Definition basic_string.hpp:435
auto insert(xtd::usize start_index, const basic_string &value) const -> basic_string
Inserts a specified instance of basic_string at a specified index position in this instance.
Definition basic_string.hpp:552
auto quoted() const -> basic_string
Allows insertion and extraction of quoted strings, such as the ones found in CSV or XML.
Definition basic_string.hpp:656
basic_string(const xtd::char16 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:231
typename base_type::value_type value_type
Represents the basic string value type.
Definition basic_string.hpp:84
typename base_type::reverse_iterator reverse_iterator
Represents the basic string reverse iterator type.
Definition basic_string.hpp:106
auto remove(xtd::usize start_index) const -> basic_string
Deletes all the characters from this basic_string beginning at a specified position and continuing th...
Definition basic_string.hpp:677
auto operator()(xtd::usize index) const -> const_reference
Returns a reference to the character at specified location index.
Definition basic_string.hpp:1396
auto ends_with(value_type value) const noexcept -> bool
Determines whether the end of this basic_string matches the specified character.
Definition basic_string.hpp:430
basic_string(std::initializer_list< xtd::char16 > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.hpp:312
auto to_char_array() const noexcept -> xtd::array< value_type >
auto pad_left(xtd::usize total_width, char32 padding_char) const noexcept -> basic_string
Right-aligns the characters in this basic_string, padding with spaces on the left for a specified tot...
Definition basic_string.hpp:636
basic_string(std::initializer_list< xtd::char8 > il)
Initializes a new instance of xtd::basic_string with specified initializer list.
Definition basic_string.hpp:318
auto index_of_any(const xtd::array< value_type > &values, xtd::usize start_index, xtd::usize count) const -> xtd::usize
Reports the index of the first occurrence in this instance of any character in a specified array of c...
static auto demangle(const basic_string &name) -> basic_string
Gets demangled basic_string of name,.
Definition basic_string.hpp:1174
auto equals(const basic_string &value) const noexcept -> bool override
Determines whether this instance and another specified xtd::basic_string object have the same value.
Definition basic_string.hpp:416
auto trim_end() const noexcept -> basic_string
Removes all trailing occurrences of white-space characters from the specified xtd::basic_string.
Definition basic_string.hpp:962
basic_string()=default
Initializes a new instance of xtd::basic_string.
auto index_of_any(const xtd::array< value_type > &values, xtd::usize start_index) const -> xtd::usize
Reports the index of the first occurrence in this instance of any character in a specified array of c...
bool starts_with(value_type value) const noexcept
Definition basic_string.hpp:815
static auto concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c) noexcept -> basic_string
Concatenates three specified instances of object.
Definition basic_string.hpp:1095
static auto compare(const basic_string &str_a, const basic_string &str_b, bool ignore_case) noexcept -> xtd::int32
Compares two specified basic_string objects, ignoring or honoring their case, and returns an integer ...
Definition basic_string.hpp:1014
basic_string(const xtd::char8 *str)
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:245
auto index_of_any(const xtd::array< value_type > &values) const noexcept -> xtd::usize
Reports the index of the first occurrence in this instance of any character in a specified array of c...
static auto concat(const basic_string &str_a, const basic_string &str_b) noexcept -> basic_string
Concatenates two specified instances of basic_string.
Definition basic_string.hpp:1100
auto last_index_of(value_type value, xtd::usize start_index) const -> xtd::usize
Reports the index of the last occurrence of the specified character in this basic_string....
Definition basic_string.hpp:589
auto is_empty() const noexcept -> bool
Name Public Deprecated Methods.
Definition basic_string.hpp:2599
auto data() const noexcept -> const_pointer
Returns a pointer to the underlying array serving as character storage. The pointer is such that the ...
Definition basic_string.hpp:356
auto index_of(value_type value, xtd::usize start_index, xtd::usize count) const -> xtd::usize
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:517
auto starts_with(const basic_string &value) const noexcept -> bool
Determines whether the beginning of this instance of xtd::basic_string matches a specified xtd::basic...
Definition basic_string.hpp:829
auto split() const noexcept -> xtd::array< basic_string >
Splits this basic_string into substrings that are based on the default white-space characters....
auto get_hash_code() const noexcept -> xtd::usize override
Returns the hash code for this basic_string.
Definition basic_string.hpp:463
auto to_string() const noexcept -> basic_string< char > override
Converts the value of this instance to a xtd::basic_string <char>.
Definition basic_string.hpp:897
auto get_enumerator() const noexcept -> enumerator_type override
Returns an enumerator that iterates through a collection.
Definition basic_string.hpp:465
typename base_type::reference reference
Represents the basic string referecne type.
Definition basic_string.hpp:92
static auto equals(const char_a_t *a, const char_b_t *b) noexcept -> bool
Determines whether two specified xtd::basic_string objects have the same value.
Definition basic_string.hpp:1191
basic_string(const std::basic_string< xtd::wchar > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:198
virtual auto count() const noexcept -> size_type
Definition basic_string.hpp:347
basic_string(char character, xtd::usize count)
Initializes a new instance of xtd::basic_string with specified count copies of character.
Definition basic_string.hpp:205
auto ends_with(const basic_string &value, xtd::string_comparison comparison_type) const noexcept -> bool
Determines whether the end of this basic_string matches the specified basic_string when compared usin...
Definition basic_string.hpp:452
static auto equals(const basic_string &a, const basic_string &b, bool ignore_case) noexcept -> bool
Determines whether two specified xtd::basic_string objects have the same value, ignoring or honoring ...
Definition basic_string.hpp:1199
typename xtd::collections::generic::ienumerable< char_t >::const_iterator const_iterator
Represents the basic string const iterator type.
Definition basic_string.hpp:104
typename base_type::difference_type difference_type
Represents the basic string difference type.
Definition basic_string.hpp:90
auto pad_left(xtd::usize total_width) const noexcept -> basic_string
Right-aligns the characters in this basic_string, padding with spaces on the left for a specified tot...
Definition basic_string.hpp:629
basic_string(const std::basic_string< xtd::char32 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:186
auto last_index_of_any(const xtd::array< value_type > &values) const noexcept -> xtd::usize
Reports the index of the last occurrence in this instance of any character in a specified array of ch...
basic_string(const std::basic_string< xtd::char8 > &str) noexcept
Initializes a new instance of xtd::basic_string with specified string to copy.
Definition basic_string.hpp:192
auto chars() const noexcept -> const base_type &
Returns a reference to the underlying base type.
Definition basic_string.hpp:339
basic_string(const xtd::collections::generic::ienumerable< char_t > &items)
Initializes a new instance of xtd::basic_string with specified ienumerable.
Definition basic_string.hpp:300
static auto is_empty(const xtd::basic_string< value_type, traits_type, allocator_type > &string) noexcept -> bool
Indicates whether the specifeid basic_string is an empty basic_string ("").
Definition basic_string.hpp:1231
basic_string(std::basic_string< char_t > &&str)
Initializes a new instance of xtd::basic_string with specified string to move.
Definition basic_string.hpp:141
static auto class_name(const object_t &object) -> basic_string
Gets the class name of the specified object.
Definition basic_string.hpp:2617
auto index_of(const basic_string &value) const noexcept -> xtd::usize
Reports the index of the first occurrence of the specified basic_string in this basic_string.
Definition basic_string.hpp:485
virtual auto size() const noexcept -> size_type
Gets the number of characters in the current xtd::basic_string object.
Definition basic_string.hpp:370
auto index_of(const basic_string &value, xtd::usize start_index, xtd::usize count) const -> xtd::usize
Reports the index of the first occurrence of the specified character in this basic_string....
Definition basic_string.hpp:497
virtual auto begin() const -> const_iterator
Definition enumerable_iterators.hpp:147
virtual auto end() const -> const_iterator
Definition enumerable_iterators.hpp:162
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:40
typename xtd::collections::generic::extensions::enumerable_iterators< xtd::any_object, xtd::collections::generic::ienumerable< xtd::any_object > >::const_iterator const_iterator
Definition ienumerable.hpp:50
typename xtd::collections::generic::extensions::enumerable_iterators< xtd::any_object, xtd::collections::generic::ienumerable< xtd::any_object > >::iterator iterator
Definition ienumerable.hpp:48
Supports a simple iteration over a generic collection.
Definition ienumerator.hpp:58
static auto combine(args_t... values) noexcept -> xtd::usize
Combines values into a hash code.
Definition hash_code.hpp:70
static auto throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current()) -> void
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:22
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
object()=default
Create a new instance of the ultimate base class object.
Represents a range that has start and end indexes.
Definition range.hpp:38
Definition character.hpp:17
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
std::basic_string_view< char_t, traits_t > basic_string_view
Represents an object that can refer to a constant contiguous sequence of char_t with the first elemen...
Definition basic_string_view.hpp:16
std::basic_string_view< char_t, traits_t > basic_read_only_string_view
Represents an object that can refer to a constant contiguous sequence of char_t with the first elemen...
Definition basic_read_only_string_view.hpp:16
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:25
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
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
auto parse(const std::string &str) -> value_t
Convert a string into a type.
Definition parse.hpp:34
auto new_ptr(args_t &&... args) -> xtd::ptr< type_t >
The xtd::new_ptr operator creates a xtd::ptr object.
Definition new_ptr.hpp:24
@ 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
auto first() const -> read_only_span< type_t, count >
Obtains a subspan consisting of the first count elements of the sequence.
Definition read_only_span.hpp:245
auto last() const -> read_only_span< type_t, count >
Obtains a subspan consisting of the last N elements of the sequence.
Definition read_only_span.hpp:286
auto operator()(size_type index) const -> const_reference
Gets the element at the specified zero-based index.
Definition read_only_span.hpp:401
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:39
Represents a type that can be used to index a collection either from the beginning or the end.
Definition index.hpp:38
Contains xtd fundamental types.