Shows how to use xtd::ustring::sprintf method.
#include <xtd/xtd>
int main() {
auto duration = 2_h + 3_min + 32_s + 24_ms + 500_ns;
console::out << string::sprintf(
"%s:%s:%s:%s", duration.to_string(
"H"), duration.to_string(
"M"), duration.to_string(
"S"), duration.to_string(
"T")) <<
environment::new_line;
console::out << string::sprintf(
"%s:%s:%s:%s", duration.to_string(
"h"), duration.to_string(
"m"), duration.to_string(
"s"), duration.to_string(
"t")) <<
environment::new_line;
}
static std::ostream out
Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output str...
Definition console.hpp:52
static xtd::string new_line() noexcept
Gets the newline string defined for this environment.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
string to_string() const noexcept override
Returns the string representation of this xtd::read_only_span <type_t> object.
Definition read_only_span.hpp:375