Package eu.svjatoslav.commons.string
Class String2
java.lang.Object
eu.svjatoslav.commons.string.String2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionappendWithSeparator
(String separator, String suffix) clear()
boolean
enforceLength
(int targetLength) static String[]
int
getSubString
(int startInclusive, int endExclusive) boolean
Check if the string has a prefix.boolean
Check if the string has a suffix.boolean
isEmpty()
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
-