iJodix Posted February 12, 2016 Posted February 12, 2016 (edited) Alright, I log this; entity.getName().trim() it returns entity name for example; Oak (nothing else) then when i use; menuOption.name.equalsIgnoreCase(entity.getName().trim()) for filter, it doesn't recognize it even though in logger it returns Oak and there shouldn't be anything else, Any ideas ? Edited February 12, 2016 by iJodix
iJodix Posted February 12, 2016 Author Posted February 12, 2016 Did you print out "menuOption.name" oh right, it'll return <col=ffff>Oak but that is why i included .trim(); at entity.getName() so it removes that bs
lisabe96 Posted February 12, 2016 Posted February 12, 2016 oh right, it'll return <col=ffff>Oak but that is why i included .trim(); at entity.getName() so it removes that bs trim doesn't remove "that bs", trim removes spaces To remove "that bs" you probably gonna have to use a substring //X = length of <col=fff> String name = menu.name.substring(X, menu.name.length); if (name.equalsIgnoreCase(...
Flamezzz Posted February 12, 2016 Posted February 12, 2016 MethodProvider#stripFormatting removes HTML tags 3
iJodix Posted February 12, 2016 Author Posted February 12, 2016 MethodProvider#stripFormatting removes HTML tags Thanks, did Optional<Option> ourOptionFilters = getMenuAPI().getMenu().stream().filter(menuOption -> stripFormatting(action).equalsIgnoreCase(stripFormatting(menuOption.action)) && stripFormatting(entity.getName()).equalsIgnoreCase(stripFormatting(menuOption.name))).findFirst(); and works perfectly