Package me.datafox.dfxengine.utils
Class StringUtils
java.lang.Object
me.datafox.dfxengine.utils.StringUtils
Utilities for manipulating strings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringcapitalize(String str) static <T> Stringstatic <T> StringconstructorName(Constructor<T> constructor) static Stringjoining(Collection<? extends CharSequence> elements, String separator, String lastSeparator) static StringreplaceLast(String str, String target, String replacement) Replaces the last occurrence of the target in a string.static String
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
replaceLast
Replaces the last occurrence of the target in a string. -
className
- Type Parameters:
T- type of the class- Parameters:
aClass- class- Returns:
Stringrepresentation of the class in ClassName.class format
-
typeName
- Parameters:
type- type- Returns:
Stringrepresentation of the type in ClassName.class format
-
constructorName
- Type Parameters:
T- type of the constructor- Parameters:
constructor- constructor- Returns:
Stringrepresentation of the constructor in ClassName(Param1.class,Param2.class) format
-
capitalize
-
joining
public static String joining(Collection<? extends CharSequence> elements, String separator, String lastSeparator) - Parameters:
elements-CharSequenceelements to be joinedseparator- separator to be usedlastSeparator- separator to be used before the last element, ornullif the normal separator should be used instead- Returns:
Stringof the elements joined together
-