xtd 0.2.0
sprintf_with_alignment.cpp

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

#include <xtd/xtd>
using namespace xtd;
int main() {
console::out << string::sprintf("[%10d]", 42) << environment::new_line;
console::out << string::sprintf("[%-10d]", 42) << environment::new_line;
console::out << string::sprintf("[%010d]", 42) << environment::new_line;
}
// This code produces the following output :
//
// [ 42]
// [42 ]
// [0000000042]
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