Java examples for Language Basics:String
Match any digits or numbers are present, in this case the
public class Main { public static void main(String[] args) throws Exception { String str = ""; str = "I love Java 8!"; boolean result = str.matches("I love Java [0-9]!"); System.out.println(result); //from www . j a v a2s . c o m } }