- public void enforceLength(final int targetLength) {
- if (getLength() > targetLength)
- chars.subList(targetLength, getLength()).clear();
- else if (getLength() < targetLength) {
- final int charactersToAdd = targetLength - getLength();
- for (int i = 0; i < charactersToAdd; i++)
- chars.add(' ');
- }
- }
+ public String2 enforceLength(final int targetLength) {
+ if (getLength() > targetLength)
+ chars.subList(targetLength, getLength()).clear();
+ else if (getLength() < targetLength) {
+ final int charactersToAdd = targetLength - getLength();
+ for (int i = 0; i < charactersToAdd; i++)
+ chars.add(' ');
+ }