im using java. Here expected outcome should be Test.Testing, but it is returning all the data in the list. Any other way to replace *

Viewed 12
List<String> list = new ArrayList<String>();
        list.add("Test.Testing");
        list.add("Test");
        list.add("Testing");
        String queryString = "*.*";
        queryString = queryString.replaceAll("\\*" , ".*");
        for (String str : list) {
                if (str.matches(queryString))
                    System.out.println(str);
        }

here expected answer should be Test.Testing

but it is returning all the data in the list.

0 Answers
Related