February 12, 20169 yr 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, 20169 yr by iJodix
February 12, 20169 yr Author 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
February 12, 20169 yr 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(...
February 12, 20169 yr Author 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
Create an account or sign in to comment