6 #define __XTD_CORE_INTERNAL__ 7 #include "internal/__generic_stream_output.h" 8 #include "internal/__format_information.h" 9 #include "internal/__format_stringer.h" 10 #include "internal/__sprintf.h" 11 #undef __XTD_CORE_INTERNAL__ 30 template<
typename ...args_t>
31 void __ustring_extract_format_arg(
xtd::ustring& fmt, std::vector<__format_information<char>>& format, args_t&& ... args);
32 void __throw_ustring_format_exception();
33 void __throw_ustring_format_exception_close_bracket();
34 void __throw_ustring_format_exception_open_bracket();
35 void __throw_ustring_format_exception_start_colon();
65 explicit
ustring(const allocator_type& allocator) noexcept;
71 ustring(
size_t count, value_type character);
77 ustring(
size_t count, value_type character, const allocator_type& allocator);
88 ustring(
size_t count,
char8 character, const allocator_type& allocator);
99 ustring(
size_t count,
char16 character, const allocator_type& allocator);
110 ustring(
size_t count,
char32 character, const allocator_type& allocator);
121 ustring(
size_t count,
wchar character, const allocator_type& allocator);
133 ustring(const
ustring& str,
size_t index,
size_t count, const allocator_type& allocator);
142 ustring(const
ustring& str,
size_t index, const allocator_type& allocator);
146 ustring(const value_type* str,
size_t count);
151 ustring(const value_type* str,
size_t count, const allocator_type& allocator);
154 ustring(const value_type* str);
158 ustring(const value_type* str, const allocator_type& allocator);
165 ustring(value_type* str, const allocator_type& allocator);
173 ustring(const
ustring& str, const allocator_type& allocator) noexcept;
177 ustring(const std::
string& str) noexcept;
181 ustring(const std::
string& str, const allocator_type& allocator) noexcept;
185 ustring(const std::u8string& str) noexcept;
189 ustring(const std::u8string& str, const allocator_type& allocator) noexcept;
196 ustring(const
char8* str, const allocator_type& allocator);
207 ustring(const std::u16string& str) noexcept;
211 ustring(const std::u16string& str, const allocator_type& allocator) noexcept;
229 ustring(const std::u32string& str) noexcept;
233 ustring(const std::u32string& str, const allocator_type& allocator) noexcept;
251 ustring(const std::wstring& str) noexcept;
255 ustring(const std::wstring& str, const allocator_type& allocator) noexcept;
262 ustring(const
wchar* str, const allocator_type& allocator);
282 template<typename input_iterator_t>
283 ustring(input_iterator_t first, input_iterator_t last) : std::basic_string<value_type>(first, last) {}
288 template<
typename input_iterator_t>
289 ustring(input_iterator_t first, input_iterator_t last,
const allocator_type& allocator) : std::basic_string<value_type>(first, last, allocator) {}
294 template<
typename string_view_like_t>
295 explicit constexpr
ustring(
const string_view_like_t& string_view,
const allocator_type& allocator = allocator_type()) : std::basic_string<value_type>(string_view, allocator) {}
302 template<
typename string_view_like_t>
303 constexpr
ustring(
const string_view_like_t& string_view,
size_type index,
size_type count,
const allocator_type& allocator = allocator_type()) : std::basic_string<value_type>(string_view, index, count, allocator) {}
307 ustring(std::initializer_list<value_type> il);
311 ustring(std::initializer_list<value_type> il,
const allocator_type& allocator);
315 ustring(std::initializer_list<char8> il);
319 ustring(std::initializer_list<char8> il,
const allocator_type& allocator);
323 ustring(std::initializer_list<char16> il);
327 ustring(std::initializer_list<char16> il,
const allocator_type& allocator);
331 ustring(std::initializer_list<char32> il);
335 ustring(std::initializer_list<char32> il,
const allocator_type& allocator);
339 ustring(std::initializer_list<wchar> il);
343 ustring(std::initializer_list<wchar> il,
const allocator_type& allocator);
363 ustring& operator =(
const std::string& str);
364 ustring& operator =(
const value_type* str);
365 ustring& operator =(
const std::u8string& str);
367 ustring& operator =(
const std::u16string& str);
369 ustring& operator =(
const std::u32string& str);
371 ustring& operator =(
const std::wstring& str);
375 ustring& operator =(value_type character);
380 ustring& operator =(
const std::initializer_list<value_type>& il);
381 ustring& operator =(
const std::initializer_list<char8>& il);
382 ustring& operator =(
const std::initializer_list<char16>& il);
383 ustring& operator =(
const std::initializer_list<char32>& il);
384 ustring& operator =(
const std::initializer_list<wchar>& il);
388 template<
typename type_t>
389 ustring operator +(
const type_t&
object)
const {
391 result.append(
object);
396 ustring& operator +=(
const std::string& str);
397 ustring& operator +=(
const value_type* str);
398 ustring& operator +=(
const std::u8string& str);
400 ustring& operator +=(
const std::u16string& str);
402 ustring& operator +=(
const std::u32string& str);
404 ustring& operator +=(
const std::wstring& str);
406 ustring& operator +=(value_type character);
411 ustring& operator +=(
const std::initializer_list<value_type>& il);
412 ustring& operator +=(
const std::initializer_list<char8>& il);
413 ustring& operator +=(
const std::initializer_list<char16>& il);
414 ustring& operator +=(
const std::initializer_list<char32>& il);
415 ustring& operator +=(
const std::initializer_list<wchar>& il);
416 template<
typename type_t>
417 ustring& operator +=(
const type_t&
object) {
418 *
this = *
this +
ustring(
object);
423 bool operator !=(
const ustring& other)
const;
424 bool operator ==(
const std::string& other)
const;
425 bool operator !=(
const std::string& other)
const;
426 bool operator ==(
const value_type* other)
const;
427 bool operator !=(
const value_type* other)
const;
428 bool operator ==(
const std::u8string& other)
const;
429 bool operator !=(
const std::u8string& other)
const;
430 bool operator ==(
const char8* other)
const;
431 bool operator !=(
const char8* other)
const;
432 bool operator ==(
const std::u16string& other)
const;
433 bool operator !=(
const std::u16string& other)
const;
434 bool operator ==(
const char16* other)
const;
435 bool operator !=(
const char16* other)
const;
436 bool operator ==(
const std::u32string& other)
const;
437 bool operator !=(
const std::u32string& other)
const;
438 bool operator ==(
const char32* other)
const;
439 bool operator !=(
const char32* other)
const;
440 bool operator ==(
const std::wstring& other)
const;
441 bool operator !=(
const std::wstring& other)
const;
442 bool operator ==(
const wchar* other)
const;
443 bool operator !=(
const wchar* other)
const;
444 const value_type& operator [](
size_t index);
445 const value_type& operator [](
size_t index)
const;
455 template<
typename object_t>
461 template<
typename object_t>
469 using std::basic_string<value_type>::compare;
529 static int32 compare(
const ustring& str_a,
size_t index_a,
const ustring& str_b,
size_t index_b,
size_t length,
bool ignore_case) noexcept;
561 template<
typename object_a_t,
typename object_b_t,
typename object_c_t,
typename object_d_t>
562 static ustring concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c, object_d_t obj_d) noexcept {
563 return format(
"{}{}{}{}", obj_a, obj_b, obj_c, obj_d);
578 template<
typename object_a_t,
typename object_b_t,
typename object_c_t>
579 static ustring concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c) noexcept {
580 return format(
"{}{}{}", obj_a, obj_b, obj_c);
593 template<
typename object_a_t,
typename object_b_t>
595 return format(
"{}{}", obj_a, obj_b);
601 static ustring concat(
const std::vector<ustring>& values) noexcept;
604 static ustring concat(
const std::vector<const value_type*>& values) noexcept;
605 static ustring concat(
const std::vector<const char8*>& values) noexcept;
606 static ustring concat(
const std::initializer_list<ustring>& values) noexcept;
607 static ustring concat(
const std::initializer_list<const value_type*>& values) noexcept;
608 static ustring concat(
const std::initializer_list<const char8*>& values) noexcept;
614 template<
typename object_t>
617 for (
const auto& arg : args)
618 result +=
format(
"{}", arg);
623 template<
typename object_t>
624 static ustring concat(
const std::initializer_list<object_t>& args) noexcept {
626 for (
const auto& arg : args)
627 result +=
format(
"{}", arg);
635 template<
typename value_t>
637 return format(
"{}", value);
667 bool equals(
const ustring& tzi)
const noexcept;
672 bool ends_with(value_type value)
const noexcept;
700 template<
typename ...args_t>
704 std::vector<__format_information<char>> formats;
705 auto begin_format_iterator = fmt.end();
706 auto end_format_iterator = fmt.end();
707 for (
auto iterator = fmt.begin(); iterator != fmt.end(); ++iterator) {
708 if (*iterator ==
'{') {
709 if (++iterator == fmt.end())
710 __throw_ustring_format_exception_open_bracket();
711 if (*iterator ==
'{')
714 begin_format_iterator = iterator;
715 while (iterator != fmt.end() && *iterator !=
'}') ++iterator;
716 if (iterator == fmt.end())
717 __throw_ustring_format_exception_open_bracket();
718 end_format_iterator = iterator;
719 __format_information<char> fi;
720 fi.location = result.size();
721 std::string format_str {begin_format_iterator, end_format_iterator};
722 if (format_str.size() == 0)
726 size_t index_format_separator =
ustring(format_str).index_of(u8
':');
728 if (index_alignment_separator != std::string::npos && index_format_separator != std::string::npos && index_alignment_separator > index_format_separator)
729 index_alignment_separator = std::string::npos;
731 if (index_alignment_separator != std::string::npos)
732 fi.alignment = format_str.substr(index_alignment_separator + 1, index_format_separator != std::string::npos ? index_format_separator - index_alignment_separator - 1 : std::string::npos);
734 if (index_format_separator != std::string::npos)
735 fi.format = format_str.substr(index_format_separator + 1);
737 if (index_alignment_separator == 0 || index_format_separator == 0)
740 std::string index_str;
741 if (index_alignment_separator != std::string::npos)
742 index_str = format_str.substr(0, index_alignment_separator);
743 else if (index_format_separator != std::string::npos)
744 index_str = format_str.substr(0, index_format_separator);
746 index_str = std::move(format_str);
748 for (
auto c : index_str)
749 if (!std::isdigit(
c)) __throw_ustring_format_exception_start_colon();
750 fi.index = std::stoi(index_str);
752 __throw_ustring_format_exception_start_colon();
756 formats.push_back(fi);
758 }
else if (*iterator ==
'}') {
759 if (++iterator == fmt.end()) {
760 __throw_ustring_format_exception_close_bracket();
763 if (*iterator !=
'}') {
764 __throw_ustring_format_exception_close_bracket();
772 __ustring_extract_format_arg(result, formats, std::forward<args_t>(args)...);
773 return result.c_str();
779 template<
typename object_t>
785 template<
typename object_t>
800 size_t index_of(value_type value)
const noexcept;
811 size_t index_of(value_type value,
size_t start_index)
const noexcept;
817 size_t index_of(
const ustring& value,
size_t start_index)
const noexcept;
824 size_t index_of(value_type value,
size_t start_index,
size_t count)
const noexcept;
831 size_t index_of(
const ustring& value,
size_t start_index,
size_t count)
const noexcept;
836 size_t index_of_any(
const std::vector<value_type>& values)
const noexcept;
842 size_t index_of_any(
const std::vector<value_type>& values,
size_t start_index)
const noexcept;
849 size_t index_of_any(
const std::vector<value_type>& values,
size_t start_index,
size_t count)
const noexcept;
852 size_t index_of_any(
const std::initializer_list<value_type>& values)
const noexcept;
853 size_t index_of_any(
const std::initializer_list<value_type>& values,
size_t start_index)
const noexcept;
854 size_t index_of_any(
const std::initializer_list<value_type>& values,
size_t start_index,
size_t count)
const noexcept;
868 [[deprecated(
"Replaced by xtd::ustring::is_empty(const xtd::ustring&) - Will be removed in version 0.4.0")]]
882 template<
typename collection_t>
892 template<
typename collection_t>
903 template<
typename collection_t>
907 for (
const auto& item : values) {
910 result +=
format(
"{}", item);
912 if (++i >= index + count)
break;
918 template<
typename value_t>
919 static ustring join(
const ustring&
separator,
const std::initializer_list<value_t>& values) noexcept {
return join(separator, std::vector<value_t>(values));}
920 template<
typename value_t>
921 static ustring join(
const ustring& separator,
const std::initializer_list<value_t>& values,
size_t index) noexcept {
return join(separator, std::vector<value_t>(values), index);}
922 template<
typename value_t>
923 static ustring join(
const ustring& separator,
const std::initializer_list<value_t>& values,
size_t index,
size_t count) noexcept {
return join(separator, std::vector<value_t>(values), index, count);}
940 size_t last_index_of(value_type value,
size_t start_index)
const noexcept;
954 size_t last_index_of(value_type value,
size_t start_index,
size_t count)
const noexcept;
972 size_t last_index_of_any(
const std::vector<value_type>& values,
size_t start_index)
const noexcept;
979 size_t last_index_of_any(
const std::vector<value_type>& values,
size_t start_index,
size_t count)
const noexcept;
982 size_t last_index_of_any(
const std::initializer_list<value_type>& values)
const noexcept;
983 size_t last_index_of_any(
const std::initializer_list<value_type>& values,
size_t start_index)
const noexcept;
984 size_t last_index_of_any(
const std::initializer_list<value_type>& values,
size_t start_index,
size_t count)
const noexcept;
1000 ustring pad_left(
size_t total_width, value_type padding_char)
const noexcept;
1015 ustring pad_right(
size_t total_width, value_type padding_char)
const noexcept;
1020 template<
typename value_t>
1022 return xtd::parse<value_t>(str);
1028 ustring remove(
size_t start_index)
const noexcept;
1034 ustring remove(
size_t start_index,
size_t count)
const noexcept;
1040 ustring replace(value_type old_char, value_type new_char)
const noexcept;
1060 std::vector<ustring>
split(
const std::vector<value_type>& separators,
size_t count,
string_split_options options)
const noexcept;
1066 std::vector<ustring>
split()
const noexcept;
1073 std::vector<ustring>
split(
const std::vector<value_type>& separators)
const noexcept;
1101 std::vector<ustring>
split(
const std::vector<value_type>& separators,
size_t count)
const noexcept;
1162 template<
typename ... args_t>
1163 static ustring sprintf(
const ustring& fmt, args_t&& ... args) noexcept {
return __sprintf(fmt.c_str(), convert_param(std::forward<args_t>(args)) ...);}
1169 bool starts_with(value_type value)
const noexcept;
1176 bool starts_with(value_type value,
bool ignore_case)
const noexcept;
1205 std::vector<value_type>
to_array()
const noexcept;
1210 std::vector<value_type>
to_array(
size_t start_index)
const noexcept;
1216 std::vector<value_type>
to_array(
size_t start_index,
size_t length)
const noexcept;
1239 ustring trim(value_type trim_char)
const noexcept;
1245 ustring trim(
const std::vector<value_type>& trim_chars)
const noexcept;
1263 ustring trim_end(
const std::vector<value_type>& trim_chars)
const noexcept;
1287 template<
typename value_t>
1290 value = parse<value_t>(str);
1299 friend std::ostream& operator <<(std::ostream& stream,
const ustring& str) {
return stream << str.c_str();}
1300 friend std::istream& operator >>(std::istream& stream,
ustring& str) {
1309 result.append(str_b);
1313 friend ustring operator +(
const ustring& str_a,
const std::string& str_b) {
1315 result.append(
ustring(str_b));
1319 friend ustring operator +(
const ustring& str_a,
const value_type* str_b) {
1321 result.append(
ustring(str_b));
1325 friend ustring operator +(
const ustring& str_a,
const std::u8string& str_b) {
1327 result.append(
ustring(str_b));
1333 result.append(
ustring(str_b));
1337 friend ustring operator +(
const ustring& str_a,
const std::u16string& str_b) {
1339 result.append(
ustring(str_b));
1345 result.append(
ustring(str_b));
1349 friend ustring operator +(
const ustring& str_a,
const std::u32string& str_b) {
1351 result.append(
ustring(str_b));
1357 result.append(
ustring(str_b));
1361 friend ustring operator +(
const ustring& str_a,
const std::wstring& str_b) {
1363 result.append(
ustring(str_b));
1369 result.append(
ustring(str_b));
1373 friend ustring operator +(
const ustring& str_a, value_type character) {
1375 result.append(
ustring(1, character));
1381 result.append(
ustring(1, character));
1387 result.append(
ustring(1, character));
1393 result.append(
ustring(1, character));
1399 result.append(
ustring(1, character));
1403 friend ustring operator +(
const ustring& str_a,
const std::initializer_list<value_type>& il) {
1409 friend ustring operator +(
const ustring& str_a,
const std::initializer_list<char8>& il) {
1415 friend ustring operator +(
const ustring& str_a,
const std::initializer_list<char16>& il) {
1421 friend ustring operator +(
const ustring& str_a,
const std::initializer_list<char32>& il) {
1427 friend ustring operator +(
const ustring& str_a,
const std::initializer_list<wchar>& il) {
1433 friend ustring operator +(
const std::string& str_a,
const ustring& str_b) {
1435 result.append(str_b);
1439 friend ustring operator +(
const value_type* str_a,
const ustring& str_b) {
1441 result.append(str_b);
1445 friend ustring operator +(
const std::u8string& str_a,
const ustring& str_b) {
1447 result.append(str_b);
1453 result.append(str_b);
1457 friend ustring operator +(
const std::u16string& str_a,
const ustring& str_b) {
1459 result.append(str_b);
1465 result.append(str_b);
1469 friend ustring operator +(
const std::u32string& str_a,
const ustring& str_b) {
1471 result.append(str_b);
1477 result.append(str_b);
1481 friend ustring operator +(
const std::wstring& str_a,
const ustring& str_b) {
1483 result.append(str_b);
1489 result.append(str_b);
1493 friend ustring operator +(value_type character,
const ustring& str_b) {
1495 result.append(str_b);
1501 result.append(str_b);
1507 result.append(str_b);
1513 result.append(str_b);
1519 result.append(str_b);
1523 friend ustring operator +(
const std::initializer_list<value_type>& il,
const ustring& str_b) {
1525 result.append(str_b);
1529 friend ustring operator +(
const std::initializer_list<char8>& il,
const ustring& str_b) {
1531 result.append(str_b);
1535 friend ustring operator +(
const std::initializer_list<char16>& il,
const ustring& str_b) {
1537 result.append(str_b);
1541 friend ustring operator +(
const std::initializer_list<char32>& il,
const ustring& str_b) {
1543 result.append(str_b);
1547 friend ustring operator +(
const std::initializer_list<wchar>& il,
const ustring& str_b) {
1549 result.append(str_b);
1555 template<
typename arg_t>
1556 static auto convert_param(arg_t&& arg) noexcept {
1557 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();
1558 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();
1559 else return std::forward<arg_t>(arg);
1564 using std::basic_string<value_type>::assign;
1565 using std::basic_string<value_type>::reserve;
1566 using std::basic_string<value_type>::shrink_to_fit;
1567 using std::basic_string<value_type>::clear;
1568 using std::basic_string<value_type>::erase;
1569 using std::basic_string<value_type>::push_back;
1570 using std::basic_string<value_type>::pop_back;
1571 using std::basic_string<value_type>::append;
1572 using std::basic_string<value_type>::replace;
1573 using std::basic_string<value_type>::resize;
1615 template <
typename type_t>
1622 template<
typename arg_t>
1623 void __ustring_extract_format_arg(std::string& fmt,
size_t& index, std::vector<__format_information<char>>& formats, arg_t&& arg) {
1625 for (
auto&
format : formats) {
1626 format.location += offset;
1627 if (
format.index == index) {
1630 if (!
format.alignment.empty()) {
1633 alignment = std::stoi(
format.alignment);
1635 __throw_ustring_format_exception();
1637 if (alignment > 0) arg_str = arg_str.
pad_left(alignment);
1638 else if (alignment < 0) arg_str = arg_str.
pad_right(-alignment);
1641 offset += arg_str.size();
1647 template <
typename ...args_t>
1648 void __xtd_ustrings_unused(args_t&& ... args) {}
1650 template<
typename ...args_t>
1651 void __ustring_extract_format_arg(
xtd::ustring& fmt, std::vector<__format_information<char>>& formats, args_t&& ... args) {
1653 (__ustring_extract_format_arg(fmt, index, formats, args), ...);
1654 __xtd_ustrings_unused(index);
size_t last_index_of(value_type value) const noexcept
Reports the index of the last occurrence of the specified character in this tring.
Contains xtd fundamental types.
static ustring full_class_name(const object_t &object)
Gets the fully qualified class name of the specified object, including the namespace of the specified...
Definition: ustring.h:786
ustring trim_start() const noexcept
Removes all leading occurrences of white-space characters from the specified xtd::ustring.
Contains xtd::iequatable interface.
int32 compare_to(const ustring &tzi) const noexcept override
Compares the current instance with another object of the same type.
ustring trim_end() const noexcept
Removes all trailing occurrences of white-space characters from the specified xtd::ustring.
Contains xtd::icomparable interface.
size_t index_of(value_type value) const noexcept
Reports the index of the first occurrence of the specified character in this string.
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition: icomparable.h:17
static ustring concat(const std::vector< object_t > &args) noexcept
Concatenates the string representations of the elements in a specified object array.
Definition: ustring.h:615
Contains xtd::parse methods.
string_split_options
Specifies whether applicable xtd::ustring::split method overloads include or omit empty substrings fr...
Definition: string_split_options.h:15
ustring pad_right(size_t total_width) const noexcept
Left-aligns the characters in this string, padding with spaces on the right for a specified total len...
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
ustring replace(value_type old_char, value_type new_char) const noexcept
Replaces all occurrences of a specified char_t in this string with another specified char_t...
constexpr ustring(const string_view_like_t &string_view, const allocator_type &allocator=allocator_type())
Initializes a new instance of xtd::ustring with specified string view of substring and allocator...
Definition: ustring.h:295
static ustring join(const ustring &separator, const collection_t &values, size_t index, size_t count) noexcept
Concatenates a specified separator string between each element of a specified Object array...
Definition: ustring.h:904
ustring(input_iterator_t first, input_iterator_t last, const allocator_type &allocator)
Initializes a new instance of xtd::ustring with specified first and last iterators of substring and a...
Definition: ustring.h:289
string_comparison
Specifies the culture, case, and sort rules to be used by certain overloads of the xtd::ustring::comp...
Definition: string_comparison.h:15
constexpr ustring(const string_view_like_t &string_view, size_type index, size_type count, const allocator_type &allocator=allocator_type())
Initializes a new instance of xtd::ustring with specified string view of substring and allocator...
Definition: ustring.h:303
static ustring concat(object_a_t obj_a, object_b_t obj_b) noexcept
Concatenates two specified instances of object.
Definition: ustring.h:594
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
Contains xtd::to_string methods.
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1098
ustring() noexcept
Initializes a new instance of xtd::ustring.
bool ends_with(value_type value) const noexcept
Determines whether the end of this string matches the specified character.
ustring substring(size_t start_index) const noexcept
Retrieves a substring from this instance. The substring starts at a specified character position and ...
bool contains(const ustring &value) const noexcept
Returns a value indicating whether a specified substring occurs within this string.
ustring trim() const noexcept
Removes all leading and trailing occurrences of white-space characters from the specified xtd::ustrin...
static int32 compare(const ustring &str_a, const ustring &str_b) noexcept
Compares two specified string objects and returns an integer that indicates their relative position i...
size_t index_of_any(const std::vector< value_type > &values) const noexcept
Reports the index of the first occurrence in this instance of any character in a specified array of c...
ustring to_lower() const noexcept
Returns a copy of the current string converted to lowercase.
static ustring class_name(const object_t &object)
Gets the class name of the specified object.
Definition: ustring.h:462
static ustring concat(const ustring &str_a, const ustring &str_b, const ustring &str_c, const ustring &str_d) noexcept
Concatenates four specified instances of string.
static value_t parse(const ustring &str)
Converts a string into a value_t type.
Definition: ustring.h:1021
ustring pad_left(size_t total_width) const noexcept
Right-aligns the characters in this string, padding with spaces on the left for a specified total len...
size_t get_hash_code() const noexcept override
Returns the hash code for this string.
ustring insert(size_t start_index, const ustring &value) const noexcept
Inserts a specified instance of string at a specified index position in this instance.
bool is_empty() const noexcept
Indicates whether this string is an empty string ("").
Definition: ustring.h:869
std::vector< ustring > split() const noexcept
Splits this string into substrings that are based on the default white-space characters. White-space characters are defined by the c++ standard and return true if they are passed to the std::isspace() or std::iswspace() method.
static ustring concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c) noexcept
Concatenates three specified instances of object.
Definition: ustring.h:579
ustring to_upper() const noexcept
Returns a copy of the current string converted to uppercase.
static ustring 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: ustring.h:562
The operating system is other.
bool starts_with(value_type value) const noexcept
Determines whether the beginning of this instance of xtd::ustring matches a specified xtd::ustring...
static bool try_parse(const ustring &str, value_t &value) noexcept
Try to convert a string into a value_t type.
Definition: ustring.h:1288
Contains xtd::object class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:31
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:74
Contains xtd::string_split_options enum class.
static ustring class_name()
Gets the class name of the object_t.
Definition: ustring.h:456
size_t last_index_of_any(const std::vector< value_type > &values) const noexcept
Reports the index of the last occurrence in this instance of any character in a specified array of ch...
char32_t char32
Represents a 32-bit unicode character.
Definition: types.h:50
static ustring full_class_name()
Gets the fully qualified class name of the objec_t, including the namespace of the objec_t...
Definition: ustring.h:780
static ustring join(const ustring &separator, const collection_t &values, size_t index) noexcept
Concatenates a specified separator string between each element of a specified object array...
Definition: ustring.h:893
std::vector< value_type > to_array() const noexcept
Copies the characters in this instance to a Unicode character array.
static const ustring empty_string
Represents the empty string.
Definition: ustring.h:55
ustring to_string() const noexcept override
Returns a sxd::ustring that represents the current object.
char8_t char8
Represents a 8-bit unicode character.
Definition: types.h:34
ustring to_ustring(int val)
Converts a signed integer to xtd::ustring.
char16_t char16
Represents a 16-bit unicode character.
Definition: types.h:42
static ustring concat(value_t value) noexcept
Creates the string representation of a specified object.
Definition: ustring.h:636
Contains xtd::string_comparison enum class.
static ustring join(const ustring separator, const collection_t &values) noexcept
Concatenates a specified separator string between each element of a specified object array...
Definition: ustring.h:883
static ustring demangle(const ustring &name)
Gets demangled string of name,.
wchar_t wchar
Represents a wide character.
Definition: types.h:185