I have two functions check if String/Strings are blank.
fun isBlank(s: String?) : Boolean {
return s.isNullOrBlank()
}
fun isBlank(vararg strings: String) : Boolean {
return strings.isEmpty() ||
strings.any { isBlank(it) }
}
So I try to call first function from the second one but seems it tries to call itself. For instance it works nice in java:
public static boolean isBlank(final String string) {
return string == null || string.trim().isEmpty();
}
public static boolean isBlank(final String... strings) {
return strings.length == 0
|| Arrays.stream(strings).anyMatch(StringUtil::isBlank);
}
How to handle such a situation in kotlin?