Is there a way to check for a char in all elements of an array?

May be this could help you for array of Strings

String[] s = {"mnmmm","sdcsdc"};
       for(String h:s){
           if(h.charAt(1)=='n')
               System.out.println(h); // prints the first mnmmm
       }

Leave a Comment