X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fcommons%2Fstring%2FString2.java;h=6b36b5b535ccba591e39b58abf3e593de25913dd;hb=49c08724984dbcc1bb45fc0c8a4cf3bf7b627178;hp=ebea058e058fe6080cc09fee31ccd1bc61cf6b9b;hpb=965adace2b47642e2ca84f499cc32683c12059c6;p=svjatoslav_commons.git diff --git a/src/main/java/eu/svjatoslav/commons/string/String2.java b/src/main/java/eu/svjatoslav/commons/string/String2.java index ebea058..6b36b5b 100755 --- a/src/main/java/eu/svjatoslav/commons/string/String2.java +++ b/src/main/java/eu/svjatoslav/commons/string/String2.java @@ -1,12 +1,7 @@ /* - * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2019, 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. + * Svjatoslav Commons - shared library of common functionality. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. */ - package eu.svjatoslav.commons.string; import java.util.ArrayList; @@ -20,6 +15,15 @@ public class String2 { addSuffix(value); } + public String2 repeat(int count){ + String value = toString(); + + for (int i = 1; i < count; i++) { + addSuffix(value); + } + return this; + } + public String2 addPrefix(final String prefix) { if (prefix == null) return this;