Jump to content

Menu


iJodix

Recommended Posts

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 by iJodix
Link to comment
Share on other sites

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(...
Link to comment
Share on other sites

MethodProvider#stripFormatting removes HTML tags smile.png

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 :)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...