Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String content;
- content = new String(Files.readAllBytes(Paths.get("sample.txt")));
- String[] words = content.split("[\W]");
- HashSet<String> existingKeywords = new HashSet<>();
- String[] keywords = {"trucate", "delete", "drop"}
- for (String s : world) {
- for (String k : keywords) {
- if (s.equalsIgnoreCase(k)) {
- if (!existingKeywords.contains(k)) {
- existingKeywords.add(k);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement