This option works
private static void replace() { String t = "Мне очень нравится Тайланд*-+"; System.out.println(t.replaceAll("[^а-яА-Я\\s]", "")); } But we must take a lot and process, and this option does not work
private static SortedSet<String> clearSet(SortedSet<String> set) { for (String string : set) { string.replaceAll("[^а-яА-Я\\s]", ""); set2.add(string); } return set2; } Question. How to write logic, leaving only letters
set2.add(string.replaceAll("[^а-яА-Я\\s]", ""))- Juriy Spb ♦