3 ms·
Hey, wait, you can use String format with positional parameters... private static String generateGuessSentence(char candidate, int count) { return
by TrianguloY 2y ago
Hey, wait, you can use String format with positional parameters...
private static String generateGuessSentence(char candidate, int count) {
return String.format(switch(count){
case 0 -> "There are no %1$ss";
case 1 -> "There is one %1$s";
default -> "There are %2$s %1$ss";
}, candidate, count);
}