return repeat(" ", left + padding) + s + repeat(" ", right + padding);
}
private static String align(String s, int maxWidth, int padding, boolean right)
{
AnsiString ansiString = new AnsiString(s);
checkState(ansiString.length() <= maxWidth, "string length is greater than max width");
String large = repeat(" ", (maxWidth - ansiString.length()) + padding);
String small = repeat(" ", padding);
return right ? (large + s + small) : (small + s + large);
}