I want to print something like a chart with minimum space in each block and a certain alignment to the space it takes up. Let's say I had a chart in python like:
Format = """ X | Y | Z
{:^5}|{:>5}|{:>5}"""
print(Format.format(4, 64, 23))
How would I do this in java. Everything I've tried doesn't include minimum white space or alignment.
System.out.println(" X | Y | Z ");
System.out.println(MessageFormat.format("{0}|{1}|{2}", 4, 64, 23));