+++ /dev/null
-/*
- * 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.
- */
-
-package eu.svjatoslav.commons.string;
-
-public class CuttableString {
-
- private String value;
-
- public CuttableString(final String value) {
- this.value = value;
- }
-
- /**
- * Cut given amount of characters from the left of the string. Return cutted
- * part.
- */
- public String cutLeft(final int cutAmount) {
-
- int actualCutAmount = cutAmount;
-
- if (actualCutAmount > value.length())
- actualCutAmount = value.length();
-
- final String result = value.substring(0, actualCutAmount);
-
- value = value.substring(actualCutAmount);
-
- return result;
- }
-
- public int getLength() {
- return value.length();
- };
-
- public String getValue() {
- return value;
- }
-
- public boolean isEmpty() {
- return value.length() == 0;
- }
-}