String (String searchedText) { final int index = searchedText.lastIndexOf('#'); if (index == -1) { return null; } String name = searchedText.substring(index + 1).trim(); return StringUtil.isEmpty(name) ? null : name; }