xtd 0.2.0
string_format_with_order.cpp

Shows how to use xtd::string::format method.

#include <xtd/console>
#include <xtd/environment>
#include <xtd/string>
#include <iostream>
using namespace xtd;
auto main() -> int {
console::out << string::format("{0,10} {1} {2:D3} {3}", "string"_s, "literal", 42, 'a') << environment::new_line;
}
// This code produces the following output :
//
// string literal 042 a
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