xtd 0.2.0
Loading...
Searching...
No Matches
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]
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10