2021-07-15 00:20:49 +02:00
|
|
|
package com.jozufozu.flywheel.util;
|
|
|
|
|
2021-08-21 00:05:41 +02:00
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
2021-07-15 00:20:49 +02:00
|
|
|
public class StringUtil {
|
2021-08-21 00:05:41 +02:00
|
|
|
|
|
|
|
public static String args(String functionName, Object... args) {
|
|
|
|
|
|
|
|
return functionName + '(' + Arrays.stream(args)
|
|
|
|
.map(Object::toString)
|
|
|
|
.collect(Collectors.joining(", ")) + ')';
|
|
|
|
}
|
|
|
|
|
2021-07-15 00:20:49 +02:00
|
|
|
public static String trimEnd(String value) {
|
|
|
|
int len = value.length();
|
|
|
|
int st = 0;
|
|
|
|
while ((st < len) && Character.isWhitespace(value.charAt(len - 1))) {
|
|
|
|
len--;
|
|
|
|
}
|
|
|
|
return value.substring(0, len);
|
|
|
|
}
|
|
|
|
}
|