Package eu.svjatoslav.commons.string
Class String2
java.lang.Object
eu.svjatoslav.commons.string.String2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendWithSeparator(String separator, String suffix) clear()booleanenforceLength(int targetLength) static String[]intgetSubString(int startInclusive, int endExclusive) booleanCheck if the string has a prefix.booleanCheck if the string has a suffix.booleanisEmpty()repeat(int count) toString()trimPrefix(int cutAmount) Cut given amount of characters from the left of the string.trimPrefixIfExists(String prefix) trimSuffix(int charsToTrim) trimSuffixIfExists(String suffix)
-
Constructor Details
-
String2
-
String2
public String2()
-
-
Method Details
-
clear
-
repeat
-
prepend
-
append
-
appendWithSeparator
-
append
-
trimPrefix
Cut given amount of characters from the left of the string.- Parameters:
cutAmount- of characters to cut- Returns:
- part that was cut.
-
trimPrefixIfExists
-
trimSuffixIfExists
-
trimSuffix
-
hasSuffix
Check if the string has a suffix.- Parameters:
suffix- to check- Returns:
- true if the string has the suffix
-
hasPrefix
Check if the string has a prefix.- Parameters:
prefix- to check- Returns:
- true if the string has the prefix
-
contains
-
enforceLength
-
getLength
public int getLength() -
getSubString
-
isEmpty
public boolean isEmpty() -
toString
-
getGroups
-