Match word in String.


String string = "this is Naveen rajput";
String keyword = "Naveen";
Boolean found = Arrays.asList(string.split(" ")).contains(keyword);
if(found){
      System.out.println("Keyword matched");}

Popular posts from this blog

Jtable with database manually in netbeans.

Join in Kotlin coroutines