iJodix Posted February 12, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...
lisabe96 Posted February 12, 2016 Share Posted February 12, 2016 Did you print out "menuOption.name" Quote Link to comment Share on other sites More sharing options...
iJodix Posted February 12, 2016 Author Share 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 Quote Link to comment Share on other sites More sharing options...
lisabe96 Posted February 12, 2016 Share 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(... Quote Link to comment Share on other sites More sharing options...
Flamezzz Posted February 12, 2016 Share Posted February 12, 2016 MethodProvider#stripFormatting removes HTML tags 3 Quote Link to comment Share on other sites More sharing options...
iJodix Posted February 12, 2016 Author Share 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 Quote Link to comment Share on other sites More sharing options...