2 * Svjatoslav Commons - shared library of common functionality.
3 * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 3 of the GNU Lesser General Public License
7 * or later as published by the Free Software Foundation.
10 package eu.svjatoslav.commons.string;
12 public class CuttableString {
16 public CuttableString(final String value) {
21 * Cut given amount of characters from the left of the string. Return cutted
24 public String cutLeft(final int cutAmount) {
26 int actualCutAmount = cutAmount;
28 if (actualCutAmount > value.length())
29 actualCutAmount = value.length();
31 final String result = value.substring(0, actualCutAmount);
33 value = value.substring(actualCutAmount);
38 public int getLength() {
39 return value.length();
42 public String getValue() {
46 public boolean isEmpty() {
47 return value.length() == 0;