JDK 25 brings powerful new features to Java and JVM developers. Here are seven new or updated features that could convince you to switch. Java continues its fast and feature-packed release schedule, ...
It's not terribly clean, but you could use indexOf() and check if it returns -1. Better than breaking out a loop.