From c8c84ff3c00094e9e87313753b659934f4d4ae72 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Tue, 14 Nov 2017 15:54:31 +0200 Subject: [PATCH] Possibility to add separator prefixed suffixes. --- src/main/java/eu/svjatoslav/commons/string/String2.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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. * -- 2.20.1