/*
* Svjatoslav Commons - shared library of common functionality.
* Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
* or later as published by the Free Software Foundation.
}
/**
- * Cut given amount of characters from the left of the string. Return cutted
- * part.
+ * Cut given amount of characters from the left of the string.
+ *
+ * @param cutAmount
+ * of characters to cut
+ * @return cutted part.
*/
public String cutLeft(final int cutAmount) {
return result;
}
- public void enforceLength(final int targetLength) {
+ public String2 enforceLength(final int targetLength) {
if (getLength() > targetLength)
chars.subList(targetLength, getLength()).clear();
else if (getLength() < targetLength) {
for (int i = 0; i < charactersToAdd; i++)
chars.add(' ');
}
+
+ return this;
}
public int getLength() {