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__
30template<
typename ...args_t>
31void __ustring_extract_format_arg(
xtd::ustring& fmt, std::vector<__format_information<char>>& format, args_t&&... args);
32void __throw_ustring_format_exception();
33void __throw_ustring_format_exception_close_bracket();
34void __throw_ustring_format_exception_open_bracket();
35void __throw_ustring_format_exception_start_colon();
54 explicit
ustring(const allocator_type& allocator) noexcept;
60 ustring(
size_t count, value_type character);
66 ustring(
size_t count, value_type character, const allocator_type& allocator);
77 ustring(
size_t count,
char8_t character, const allocator_type& allocator);
82 ustring(
size_t count,
char16_t character);
88 ustring(
size_t count,
char16_t character, const allocator_type& allocator);
93 ustring(
size_t count,
char32_t character);
99 ustring(
size_t count,
char32_t character, const allocator_type& allocator);
110 ustring(
size_t count,
wchar_t character, const allocator_type& allocator);
122 ustring(const
ustring& str,
size_t index,
size_t count, const allocator_type& allocator);
140 ustring(const value_type* str,
size_t count, const allocator_type& allocator);
147 ustring(const value_type* str, const allocator_type& allocator);
154 ustring(value_type* str, const allocator_type& allocator);
170 ustring(const std::
string& str, const allocator_type& allocator) noexcept;
178 ustring(const std::u8string& str, const allocator_type& allocator) noexcept;
185 ustring(const
char8_t* str, const allocator_type& allocator);
192 ustring(
char8_t* str, const allocator_type& allocator);
200 ustring(const std::u16string& str, const allocator_type& allocator) noexcept;
207 ustring(const
char16_t* str, const allocator_type& allocator);
214 ustring(
char16_t* str, const allocator_type& allocator);
222 ustring(const std::u32string& str, const allocator_type& allocator) noexcept;
229 ustring(const
char32_t* str, const allocator_type& allocator);
236 ustring(
char32_t* str, const allocator_type& allocator);
244 ustring(const std::wstring& str, const allocator_type& allocator) noexcept;
251 ustring(const
wchar_t* str, const allocator_type& allocator);
258 ustring(
wchar_t* str, const allocator_type& allocator);
271 template<typename input_iterator_t>
272 ustring(input_iterator_t first, input_iterator_t last) : std::basic_string<value_type>(first, last) {}
277 template<
typename input_iterator_t>
278 ustring(input_iterator_t first, input_iterator_t last,
const allocator_type& allocator) : std::basic_string<value_type>(first, last, allocator) {}
282 ustring(std::initializer_list<value_type> il);
286 ustring(std::initializer_list<value_type> il,
const allocator_type& allocator);
294 ustring(std::initializer_list<char8_t> il,
const allocator_type& allocator);
302 ustring(std::initializer_list<char16_t> il,
const allocator_type& allocator);
310 ustring(std::initializer_list<char32_t> il,
const allocator_type& allocator);
318 ustring(std::initializer_list<wchar_t> il,
const allocator_type& allocator);
337 ustring& operator=(
const std::string& str);
338 ustring& operator=(
const value_type* str);
339 ustring& operator=(
const std::u8string& str);
340 ustring& operator=(
const char8_t* str);
341 ustring& operator=(
const std::u16string& str);
342 ustring& operator=(
const char16_t* str);
343 ustring& operator=(
const std::u32string& str);
344 ustring& operator=(
const char32_t* str);
345 ustring& operator=(
const std::wstring& str);
346 ustring& operator=(
const wchar_t* str);
349 ustring& operator=(value_type character);
350 ustring& operator=(
char8_t character);
351 ustring& operator=(
char16_t character);
352 ustring& operator=(
char32_t character);
353 ustring& operator=(
wchar_t character);
354 ustring& operator=(
const std::initializer_list<value_type>& il);
355 ustring& operator=(
const std::initializer_list<char8_t>& il);
356 ustring& operator=(
const std::initializer_list<char16_t>& il);
357 ustring& operator=(
const std::initializer_list<char32_t>& il);
358 ustring& operator=(
const std::initializer_list<wchar_t>& il);
362 template<
typename type_t>
363 ustring operator+(
const type_t&
object)
const {
365 result.append(
object);
370 ustring& operator+=(
const std::string& str);
371 ustring& operator+=(
const value_type* str);
372 ustring& operator+=(
const std::u8string& str);
373 ustring& operator+=(
const char8_t* str);
374 ustring& operator+=(
const std::u16string& str);
375 ustring& operator+=(
const char16_t* str);
376 ustring& operator+=(
const std::u32string& str);
377 ustring& operator+=(
const char32_t* str);
378 ustring& operator+=(
const std::wstring& str);
379 ustring& operator+=(
const wchar_t* str);
380 ustring& operator+=(value_type character);
381 ustring& operator+=(
char8_t character);
382 ustring& operator+=(
char16_t character);
383 ustring& operator+=(
char32_t character);
384 ustring& operator+=(
wchar_t character);
385 ustring& operator+=(
const std::initializer_list<value_type>& il);
386 ustring& operator+=(
const std::initializer_list<char8_t>& il);
387 ustring& operator+=(
const std::initializer_list<char16_t>& il);
388 ustring& operator+=(
const std::initializer_list<char32_t>& il);
389 ustring& operator+=(
const std::initializer_list<wchar_t>& il);
390 template<
typename type_t>
391 ustring& operator+=(
const type_t&
object) {
392 *
this = *
this +
ustring(
object);
396 bool operator==(
const ustring& other)
const;
397 bool operator!=(
const ustring& other)
const;
398 bool operator==(
const std::string other)
const;
399 bool operator!=(
const std::string other)
const;
400 bool operator==(
const value_type* other)
const;
401 bool operator!=(
const value_type* other)
const;
402 bool operator==(
const std::u8string other)
const;
403 bool operator!=(
const std::u8string other)
const;
404 bool operator==(
const char8_t* other)
const;
405 bool operator!=(
const char8_t* other)
const;
406 bool operator==(
const std::u16string other)
const;
407 bool operator!=(
const std::u16string other)
const;
408 bool operator==(
const char16_t* other)
const;
409 bool operator!=(
const char16_t* other)
const;
410 bool operator==(
const std::u32string other)
const;
411 bool operator!=(
const std::u32string other)
const;
412 bool operator==(
const char32_t* other)
const;
413 bool operator!=(
const char32_t* other)
const;
414 bool operator==(
const std::wstring other)
const;
415 bool operator!=(
const std::wstring other)
const;
416 bool operator==(
const wchar_t* other)
const;
417 bool operator!=(
const wchar_t* other)
const;
418 const value_type& operator[](
size_t index);
419 const value_type& operator[](
size_t index)
const;
420 ustring substr(size_type index = 0, size_type count = npos)
const;
426 template<
typename object_t>
432 template<
typename object_t>
443 template<
typename object_t>
449 template<
typename object_t>
457 using std::basic_string<value_type>
::compare;
503 static int compare(
const ustring& str_a,
size_t index_a,
const ustring& str_b,
size_t index_b,
size_t length)
noexcept;
517 static int compare(
const ustring& str_a,
size_t index_a,
const ustring& str_b,
size_t index_b,
size_t length,
bool ignore_case)
noexcept;
547 template<
typename object_a_t,
typename object_b_t,
typename object_c_t,
typename object_d_t>
548 static ustring concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c, object_d_t obj_d)
noexcept {
549 return format(
"{}{}{}{}", obj_a, obj_b, obj_c, obj_d);
564 template<
typename object_a_t,
typename object_b_t,
typename object_c_t>
565 static ustring concat(object_a_t obj_a, object_b_t obj_b, object_c_t obj_c)
noexcept {
566 return format(
"{}{}{}", obj_a, obj_b, obj_c);
579 template<
typename object_a_t,
typename object_b_t>
581 return format(
"{}{}", obj_a, obj_b);
590 static ustring concat(
const std::vector<const value_type*>& values)
noexcept;
591 static ustring concat(
const std::vector<const char8_t*>& values)
noexcept;
592 static ustring concat(
const std::initializer_list<ustring>& values)
noexcept;
593 static ustring concat(
const std::initializer_list<const value_type*>& values)
noexcept;
594 static ustring concat(
const std::initializer_list<const char8_t*>& values)
noexcept;
600 template<
typename object_t>
603 for (
const auto& arg : args)
604 result +=
format(
"{}", arg);
609 template<
typename object_t>
610 static ustring concat(
const std::initializer_list<object_t>& args)
noexcept {
612 for (
const auto& arg : args)
613 result +=
format(
"{}", arg);
621 template<
typename value_t>
623 return format(
"{}", value);
631 for (
auto& item : {
"enum ",
"class ",
"union ",
"struct "})
632 result = result.
replace(item,
"");
635 class auto_delete_char_pointer {
637 auto_delete_char_pointer(
char* value) : value_(value) {}
638 ~auto_delete_char_pointer() {free(value_);}
639 char* operator()()
const {
return value_;}
644 return auto_delete_char_pointer(abi::__cxa_demangle(name.c_str(), 0, 0, &status))();
688 template<typename ...args_t>
692 std::vector<__format_information<char>> formats;
693 typename ustring::const_iterator begin_format_iterator = fmt.cend();
694 typename ustring::const_iterator end_format_iterator = fmt.cend();
695 for (
typename ustring::const_iterator iterator = fmt.cbegin(); iterator != fmt.cend(); ++iterator) {
696 if (*iterator ==
'{') {
698 if (*iterator ==
'{')
701 begin_format_iterator = iterator;
702 while (*iterator !=
'}' && iterator != fmt.end()) ++iterator;
703 if (iterator == fmt.end())
704 __throw_ustring_format_exception_open_bracket();
705 end_format_iterator = iterator;
706 __format_information<char> fi;
707 fi.location = result.size();
708 std::string
format {begin_format_iterator, end_format_iterator};
712 size_t index_alignment_separator =
ustring(
format).index_of(
',');
713 size_t index_format_separator =
ustring(
format).index_of(u8
':');
715 if (index_alignment_separator != std::string::npos && index_format_separator != std::string::npos && index_alignment_separator > index_format_separator)
716 index_alignment_separator = std::string::npos;
718 if (index_alignment_separator != std::string::npos)
719 fi.alignment =
format.substr(index_alignment_separator + 1, index_format_separator != std::string::npos ? index_format_separator - index_alignment_separator - 1 : std::string::npos);
721 if (index_format_separator != std::string::npos)
724 if (index_alignment_separator == 0 || index_format_separator == 0)
727 std::string index_str;
728 if (index_alignment_separator != std::string::npos)
729 index_str =
format.substr(0, index_alignment_separator);
730 else if (index_format_separator != std::string::npos)
731 index_str =
format.substr(0, index_format_separator);
735 for (
auto c : index_str)
736 if (!std::isdigit(
c)) __throw_ustring_format_exception_start_colon();
737 fi.index = std::stoi(index_str);
739 __throw_ustring_format_exception_start_colon();
743 formats.push_back(fi);
745 }
else if (*iterator ==
'}') {
746 if (++iterator == fmt.cend())
747 __throw_ustring_format_exception_close_bracket();
748 if (*iterator !=
'}')
749 __throw_ustring_format_exception_close_bracket();
755 __ustring_extract_format_arg(result, formats, std::forward<args_t>(args)...);
756 return result.c_str();
777 size_t index_of(value_type value,
size_t start_index) const noexcept;
790 size_t index_of(value_type value,
size_t start_index,
size_t count) const noexcept;
797 size_t index_of(const
ustring& value,
size_t start_index,
size_t count) const noexcept;
802 size_t index_of_any(const std::vector<value_type>& values) const noexcept;
808 size_t index_of_any(const std::vector<value_type>& values,
size_t start_index) const noexcept;
815 size_t index_of_any(const std::vector<value_type>& values,
size_t start_index,
size_t count) const noexcept;
818 size_t index_of_any(const std::initializer_list<value_type>& values) const noexcept;
819 size_t index_of_any(const std::initializer_list<value_type>& values,
size_t start_index) const noexcept;
820 size_t index_of_any(const std::initializer_list<value_type>& values,
size_t start_index,
size_t count) const noexcept;
841 template<typename collection_t>
851 template<
typename collection_t>
862 template<
typename collection_t>
866 for (
const auto& item : values) {
869 result +=
format(
"{}", item);
871 if (++
i >= index + count)
break;
877 template<
typename value_t>
879 template<
typename value_t>
881 template<
typename value_t>
882 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);}
913 size_t last_index_of(value_type value,
size_t start_index,
size_t count)
const noexcept;
931 size_t last_index_of_any(
const std::vector<value_type>& values,
size_t start_index)
const noexcept;
938 size_t last_index_of_any(
const std::vector<value_type>& values,
size_t start_index,
size_t count)
const noexcept;
941 size_t last_index_of_any(
const std::initializer_list<value_type>& values)
const noexcept;
942 size_t last_index_of_any(
const std::initializer_list<value_type>& values,
size_t start_index)
const noexcept;
943 size_t last_index_of_any(
const std::initializer_list<value_type>& values,
size_t start_index,
size_t count)
const noexcept;
1017 std::vector<ustring>
split() const noexcept;
1024 std::vector<
ustring>
split(const std::vector<value_type>& separators) const noexcept;
1052 std::vector<
ustring>
split(const std::vector<value_type>& separators,
size_t count) const noexcept;
1113 template<typename ... args_t>
1114 static
ustring sprintf(const
ustring& fmt, args_t&& ... args) noexcept {
return __sprintf(fmt.c_str(), convert_param(std::forward<args_t>(args)) ...);}
1161 std::vector<value_type>
to_array(
size_t start_index) const noexcept;
1167 std::vector<value_type>
to_array(
size_t start_index,
size_t length) const noexcept;
1196 ustring trim(const std::vector<value_type>& trim_chars) const noexcept;
1234 template<typename value_t>
1235 static value_t parse(const
ustring& str) {
1236 return xtd::parse<value_t>(str);
1239 template<
typename value_t>
1240 static bool try_parse(
const ustring& str, value_t& value) {
1242 value = parse<value_t>(str);
1250 friend std::ostream& operator<<(std::ostream& stream,
const ustring& str) {
return stream << str.c_str();}
1251 friend std::istream& operator>>(std::istream& stream,
ustring& str) {
1260 result.append(str_b);
1264 friend ustring operator+(
const ustring& str_a,
const std::string& str_b) {
1266 result.append(
ustring(str_b));
1270 friend ustring operator+(
const ustring& str_a,
const value_type* str_b) {
1272 result.append(
ustring(str_b));
1276 friend ustring operator+(
const ustring& str_a,
const std::u8string& str_b) {
1278 result.append(
ustring(str_b));
1282 friend ustring operator+(
const ustring& str_a,
const char8_t* str_b) {
1284 result.append(
ustring(str_b));
1288 friend ustring operator+(
const ustring& str_a,
const std::u16string& str_b) {
1290 result.append(
ustring(str_b));
1294 friend ustring operator+(
const ustring& str_a,
const char16_t* str_b) {
1296 result.append(
ustring(str_b));
1300 friend ustring operator+(
const ustring& str_a,
const std::u32string& str_b) {
1302 result.append(
ustring(str_b));
1306 friend ustring operator+(
const ustring& str_a,
const char32_t* str_b) {
1308 result.append(
ustring(str_b));
1312 friend ustring operator+(
const ustring& str_a,
const std::wstring& str_b) {
1314 result.append(
ustring(str_b));
1318 friend ustring operator+(
const ustring& str_a,
const wchar_t* str_b) {
1320 result.append(
ustring(str_b));
1324 friend ustring operator+(
const ustring& str_a, value_type character) {
1326 result.append(
ustring(1, character));
1330 friend ustring operator+(
const ustring& str_a,
char8_t character) {
1332 result.append(
ustring(1, character));
1336 friend ustring operator+(
const ustring& str_a,
char16_t character) {
1338 result.append(
ustring(1, character));
1342 friend ustring operator+(
const ustring& str_a,
char32_t character) {
1344 result.append(
ustring(1, character));
1348 friend ustring operator+(
const ustring& str_a,
wchar_t character) {
1350 result.append(
ustring(1, character));
1354 friend ustring operator+(
const ustring& str_a,
const std::initializer_list<value_type>& il) {
1360 friend ustring operator+(
const ustring& str_a,
const std::initializer_list<char8_t>& il) {
1366 friend ustring operator+(
const ustring& str_a,
const std::initializer_list<char16_t>& il) {
1372 friend ustring operator+(
const ustring& str_a,
const std::initializer_list<char32_t>& il) {
1378 friend ustring operator+(
const ustring& str_a,
const std::initializer_list<wchar_t>& il) {
1384 friend ustring operator+(
const std::string& str_a,
const ustring& str_b) {
1386 result.append(str_b);
1390 friend ustring operator+(
const value_type* str_a,
const ustring& str_b) {
1392 result.append(str_b);
1396 friend ustring operator+(
const std::u8string& str_a,
const ustring& str_b) {
1398 result.append(str_b);
1402 friend ustring operator+(
const char8_t* str_a,
const ustring& str_b) {
1404 result.append(str_b);
1408 friend ustring operator+(
const std::u16string& str_a,
const ustring& str_b) {
1410 result.append(str_b);
1414 friend ustring operator+(
const char16_t* str_a,
const ustring& str_b) {
1416 result.append(str_b);
1420 friend ustring operator+(
const std::u32string& str_a,
const ustring& str_b) {
1422 result.append(str_b);
1426 friend ustring operator+(
const char32_t* str_a,
const ustring& str_b) {
1428 result.append(str_b);
1432 friend ustring operator+(
const std::wstring& str_a,
const ustring& str_b) {
1434 result.append(str_b);
1438 friend ustring operator+(
const wchar_t* str_a,
const ustring& str_b) {
1440 result.append(str_b);
1444 friend ustring operator+(value_type character,
const ustring& str_b) {
1446 result.append(str_b);
1450 friend ustring operator+(
char8_t character,
const ustring& str_b) {
1452 result.append(str_b);
1456 friend ustring operator+(
char16_t character,
const ustring& str_b) {
1458 result.append(str_b);
1462 friend ustring operator+(
char32_t character,
const ustring& str_b) {
1464 result.append(str_b);
1468 friend ustring operator+(
wchar_t character,
const ustring& str_b) {
1470 result.append(str_b);
1474 friend ustring operator+(
const std::initializer_list<value_type>& il,
const ustring& str_b) {
1476 result.append(str_b);
1480 friend ustring operator+(
const std::initializer_list<char8_t>& il,
const ustring& str_b) {
1482 result.append(str_b);
1486 friend ustring operator+(
const std::initializer_list<char16_t>& il,
const ustring& str_b) {
1488 result.append(str_b);
1492 friend ustring operator+(
const std::initializer_list<char32_t>& il,
const ustring& str_b) {
1494 result.append(str_b);
1498 friend ustring operator+(
const std::initializer_list<wchar_t>& il,
const ustring& str_b) {
1500 result.append(str_b);
1506 template<
typename arg_t>
1507 static auto convert_param(arg_t&& arg)
noexcept {
1508 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();
1509 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();
1510 else return std::forward<arg_t>(arg);
1515 using std::basic_string<value_type>::assign;
1516 using std::basic_string<value_type>::reserve;
1517 using std::basic_string<value_type>::shrink_to_fit;
1518 using std::basic_string<value_type>
::clear;
1519 using std::basic_string<value_type>::erase;
1520 using std::basic_string<value_type>::push_back;
1521 using std::basic_string<value_type>::pop_back;
1522 using std::basic_string<value_type>::append;
1523 using std::basic_string<value_type>
::replace;
1524 using std::basic_string<value_type>::resize;
1566 template <
typename type_t>
1573template<
typename arg_t>
1574void __ustring_extract_format_arg(std::string& fmt,
size_t& index, std::vector<__format_information<char>>& formats, arg_t&& arg) {
1576 for (
auto& format : formats) {
1577 format.location += offset;
1578 if (format.index == index) {
1581 if (!format.alignment.empty()) {
1584 alignment = std::stoi(format.alignment);
1586 __throw_ustring_format_exception();
1588 if (alignment > 0) arg_str = arg_str.
pad_left(alignment);
1589 else if (alignment < 0) arg_str = arg_str.
pad_right(-alignment);
1591 fmt.
insert(format.location, arg_str);
1592 offset += arg_str.size();
1598template <
typename ...args_t>
1599void __xtd_ustrings_unused(args_t&& ... args) {}
1601template<
typename ...args_t>
1602void __ustring_extract_format_arg(
xtd::ustring& fmt, std::vector<__format_information<char>>& formats, args_t&&... args) {
1604 (__ustring_extract_format_arg(fmt, index, formats, args),...);
1605 __xtd_ustrings_unused(index);
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:26
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:48
ustring(std::initializer_list< value_type > il, const allocator_type &allocator)
Initializes a new instance of xtd::ustring with specified initializer list and allocator.
ustring remove(size_t start_index, size_t count) const noexcept
Deletes all the characters from this string beginning at a specified position and continuing through ...
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:565
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...
size_t last_index_of(const ustring &value, size_t start_index) const noexcept
Reports the index of the last occurrence of the specified character in this string....
size_t last_index_of(const ustring &value, size_t start_index, size_t count) const noexcept
Reports the index of the last occurrence of the specified character in this string....
ustring(std::initializer_list< char32_t > il, const allocator_type &allocator)
Initializes a new instance of xtd::ustring with specified initializer list and allocator.
ustring(std::initializer_list< char32_t > il)
Initializes a new instance of xtd::ustring with specified initializer list.
size_t last_index_of(value_type value) const noexcept
Reports the index of the last occurrence of the specified character in this tring.
ustring(std::initializer_list< wchar_t > il)
Initializes a new instance of xtd::ustring with specified initializer list.
bool is_empty() const noexcept
Indicates whether this string is an empty string ("").
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:278
static ustring demangle(const ustring &name)
Gets demangled string of name,.
Definition ustring.h:628
static int compare(const ustring &str_a, size_t index_a, const ustring &str_b, size_t index_b, size_t length, xtd::string_comparison comparison_type) noexcept
Compares substrings of two specified string objects using the specified rules, and returns an integer...
ustring(std::initializer_list< char8_t > il)
Initializes a new instance of xtd::ustring with specified initializer list.
ustring(std::initializer_list< value_type > il)
Initializes a new instance of xtd::ustring with specified initializer list.
size_t last_index_of(value_type value, size_t start_index) const noexcept
Reports the index of the last occurrence of the specified character in this string....
ustring substring(size_t start_index, size_t length) const noexcept
Retrieves a substring from this instance. The substring starts at a specified character position and ...
static ustring concat(value_t value) noexcept
Creates the string representation of a specified object.
Definition ustring.h:622
ustring replace(const ustring &old_string, const ustring &new_string) const noexcept
Replaces all occurrences of a specified string in this string with another specified string.
ustring pad_left(size_t total_width, value_type padding_char) const noexcept
Right-aligns the characters in this string, padding with spaces on the left for a specified total len...
ustring to_upper() const noexcept
Returns a copy of the current string converted to uppercase.
static int compare(const ustring &str_a, const ustring &str_b, bool ignore_case) noexcept
Compares two specified string objects, ignoring or honoring their case, and returns an integer that i...
ustring pad_right(size_t total_width, value_type padding_char) const noexcept
Left-aligns the characters in this string, padding with spaces on the right for a specified total len...
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.
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:863
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...
std::vector< value_type > to_array() const noexcept
Copies the characters in this instance to a Unicode character array.
ustring(std::initializer_list< char16_t > il)
Initializes a new instance of xtd::ustring with specified initializer list.
static ustring class_name(const object_t &object)
Gets the class name of the specified object.
Definition ustring.h:450
ustring trim() const noexcept
Removes all leading and trailing occurrences of white-space characters from the specified String.
std::vector< ustring > split(const std::vector< value_type > &separators, size_t count, string_split_options options) const noexcept
Splits this string into a maximum number of substrings based on the characters in an array.
std::vector< ustring > split() const noexcept
Splits this string into substrings that are based on the default white-space characters....
ustring trim_end() const noexcept
Removes all trailing occurrences of white-space characters from the specified String.
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:548
size_t index_of(value_type value) const noexcept
Reports the index of the first occurrence of the specified character in this string.
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...
bool starts_with(value_type value, bool ignore_case) const noexcept
Determines whether the beginning of this instance of String matches a specified String,...
static ustring class_name(const std::type_info &info)
Gets the class name of the specified object.
Definition ustring.h:455
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:601
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:433
ustring(std::initializer_list< char16_t > il, const allocator_type &allocator)
Initializes a new instance of xtd::ustring with specified initializer list and allocator.
ustring trim_start() const noexcept
Removes all leading occurrences of white-space characters from the specified String.
size_t last_index_of(const ustring &value) const noexcept
Reports the index of the last occurrence of the specified string in this string.
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.
static int compare(const ustring &str_a, size_t index_a, const ustring &str_b, size_t index_b, size_t length, bool ignore_case) noexcept
Compares substrings of two specified string objects, ignoring or honoring their case,...
static ustring empty_string() noexcept
Represents the empty string.
size_t last_index_of_any(const std::vector< value_type > &values, size_t start_index, size_t count) const noexcept
Reports the index of the last occurrence in this instance of any character in a specified array of ch...
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:842
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 ustring full_class_name()
Gets the fully qualified class name of the objec_t, including the namespace of the objec_t.
Definition ustring.h:427
static ustring concat(object_a_t obj_a, object_b_t obj_b) noexcept
Concatenates two specified instances of object.
Definition ustring.h:580
static int compare(const ustring &str_a, const ustring &str_b, xtd::string_comparison comparison_type) noexcept
Compares two specified string objects using the specified rules, and returns an integer that indicate...
static int 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...
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...
static ustring class_name()
Gets the class name of the object_t.
Definition ustring.h:444
size_t last_index_of(value_type value, size_t start_index, size_t count) const noexcept
Reports the index of the last occurrence of the specified character in this string....
bool ends_with(value_type value) const noexcept
Determines whether the end of this string matches the specified character.
size_t get_hash_code() const noexcept override
Returns the hash code for this string.
bool starts_with(const ustring &value) const noexcept
Determines whether the beginning of this instance of String matches a specified String.
ustring(std::initializer_list< wchar_t > il, const allocator_type &allocator)
Initializes a new instance of xtd::ustring with specified initializer list and allocator.
ustring remove(size_t start_index) const noexcept
Deletes all the characters from this string beginning at a specified position and continuing through ...
static ustring concat(const std::vector< ustring > &values) noexcept
Concatenates the elements of a specified string array.
static ustring concat(const ustring &str_a, const ustring &str_b, const ustring &str_c) noexcept
Concatenates three specified instances of string.
ustring substring(size_t start_index) const noexcept
Retrieves a substring from this instance. The substring starts at a specified character position and ...
ustring() noexcept
Initializes a new instance of xtd::ustring.
bool starts_with(value_type value) const noexcept
Determines whether the beginning of this instance of String matches a specified String.
ustring to_string() const noexcept override
Returns a std::string that represents the current object.
ustring(std::initializer_list< char8_t > il, const allocator_type &allocator)
Initializes a new instance of xtd::ustring with specified initializer list and allocator.
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:852
static ustring concat(const ustring &str_a, const ustring &str_b) noexcept
Concatenates two specified instances of string.
bool contains(const ustring &value) const noexcept
Returns a value indicating whether a specified substring occurs within this string.
size_t last_index_of_any(const std::vector< value_type > &values, size_t start_index) const noexcept
Reports the index of the last occurrence in this instance of any character in a specified array of ch...
ustring to_lower() const noexcept
Returns a copy of the current string converted to lowercase.
static int compare(const ustring &str_a, size_t index_a, const ustring &str_b, size_t index_b, size_t length) noexcept
Compares substrings of two specified string objects and returns an integer that indicates their relat...
bool starts_with(const ustring &value, bool ignore_case) const noexcept
Determines whether the beginning of this instance of String matches a specified String,...
static ustring 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 ustring.h:438
string_comparison
Specifies the culture, case, and sort rules to be used by certain overloads of the xtd::ustring::comp...
Definition string_comparison.h:17
string_split_options
Specifies whether applicable xtd::ustring::split method overloads include or omit empty substrings fr...
Definition string_split_options.h:17
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition to_string.h:37
@ separator
The Separator key.
@ insert
The INS (INSERT) key.
@ stream
Supports reliable, two-way, connection-based byte streams without the duplication of data and without...
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17
ustring to_ustring(int val)
Converts a signed integer to xtd::ustring.
Contains xtd::object class.
Contains xtd::parse methods.
Contains xtd::string_comparison enum class.
Contains xtd::string_split_options enum class.
Contains xtd::to_string methods.
Contains xtd fundamental types.