public static String pad(String source, char filler, int length) {

		if (length == 0) {
			return source;
		}

		boolean rightJustify = true;
		if (length < 0) {
			rightJustify = false;
			length *= -1;
		}

		int n = length - source.length();
		StringBuilder buffer = new StringBuilder();
		for (int i = 0; i < n; i++) {
			buffer.append(filler);
		}

		if (rightJustify) {
			buffer.append(source);
		}
		else {
			buffer.insert(0, source);
		}

		return buffer.toString();
	}
Pads the source string to the specified length, using the filler string as the pad. If length
is negative, left justifies the string, appending the filler; if length is positive, right
justifies the source string.

@param source the original string to pad.
@param filler the type of characters with which to pad
@param length the length of padding to add (0 results in no changes)
@return the padded string
Ghidra/Framework/Generic/src/main/java/ghidra/util/StringUtilities.java