From: Svjatoslav Agejenko Date: Tue, 14 Nov 2017 13:54:31 +0000 (+0200) Subject: Possibility to add separator prefixed suffixes. X-Git-Tag: svjatoslavcommons-1.8~44 X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=c8c84ff3c00094e9e87313753b659934f4d4ae72;p=svjatoslav_commons.git Possibility to add separator prefixed suffixes. --- diff --git a/src/main/java/eu/svjatoslav/commons/string/String2.java b/src/main/java/eu/svjatoslav/commons/string/String2.java index 4c1627f..2e9446a 100755 --- a/src/main/java/eu/svjatoslav/commons/string/String2.java +++ b/src/main/java/eu/svjatoslav/commons/string/String2.java @@ -46,6 +46,14 @@ public class String2 { return this; } + public String2 addSuffix(String separator, final String suffix) { + if (!isEmpty()) + addSuffix(separator); + + addSuffix(suffix); + + return this; + } /** * Cut given amount of characters from the left of the string. *