I am posting sample data from my web application
// These are available role ids of a user. These data are dynamic and retrieved from DB.
String givenroleids ="12,14,18" ;
Now I have another String selectedroleid="2" // This is a role selected from select box . This value can be dynamic .
I want to check whether selectedroleid is in givenroleids . How do I do it ?
in this case result will be false because selectedroleid is not in givenroleids .
but suppose selectedroleid ="12" ,in this case result will be true because selectedroleid is in givenroleids .