Package javatapas.string
Class FixedLengthPadding
java.lang.Object
javatapas.string.FixedLengthPadding
public class FixedLengthPadding extends Object
Return a String padded to a fixed length using a specified padding character.
Published at https://www.javatapas.com/string/Java-Fixed-Length-Padding.html
Javadoc at https://www.javatapas.com/docs/javatapas/string/FixedLengthPadding.html
Published at https://www.javatapas.com/string/Java-Fixed-Length-Padding.html
Javadoc at https://www.javatapas.com/docs/javatapas/string/FixedLengthPadding.html
- Version:
- 2021-05-18
- Author:
- Kodiak Brown
-
Constructor Summary
Constructors Constructor Description FixedLengthPadding()
-
Method Summary
Modifier and Type Method Description static String
fixedLengthPadding(String inStr, int fixedInt)
This calls the fixedLength method with the default settings of blank spaces as the pad character, and remaining text is right justifiedstatic String
fixedLengthPadding(String inStr, int fixedInt, char pad, boolean rightLeft)
-
Constructor Details
-
FixedLengthPadding
public FixedLengthPadding()
-
-
Method Details
-
fixedLengthPadding
This calls the fixedLength method with the default settings of blank spaces as the pad character, and remaining text is right justified- Parameters:
inStr
- The input String to be padded to a fixed length.fixedInt
- The length of the output String.
-
fixedLengthPadding
- Parameters:
inStr
- The input String to be padded to a fixed length.fixedInt
- The length of the output String.pad
- The character to pad the String with.rightLeft
- If true the output String will be right justified, otherwise it will be left justified.
-