xtd 0.2.0
Loading...
Searching...
No Matches
split.cpp

Shows how to use xtd::ustring::split method.

#include <xtd/console>
#include <xtd/ustring>
using namespace xtd;
auto main()->int {
auto strings = ustring("One Two Three\tFour\nFive").split();
console::write_line("strings.size = {}", strings.size());
for (auto string : strings)
console::write_line(string);
}
// This code produces the following output:
//
// strings.size = 5
// One
// Two
// Three
// Four
// Five
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
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.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10