String s ='Hello';
Set<String> st = new Set<String>();
st.add('world');
st.add('Hello')
if(st.conatins(s)){
System.debug('String is contains in Set');
}else{
System.debug('NOOO');
}
String s ='Hello';
Set<String> st = new Set<String>();
st.add('world');
st.add('Hello')
if(st.conatins(s)){
System.debug('String is contains in Set');
}else{
System.debug('NOOO');
}
All Answers
Loop over the Set of values and inside for loop compare your String value.
Example:
Set<ID> setIds = New Set<ID>();
String str = 'value';
for(ID ids : setIds){
if(ids == str){
// your logic
}
}
Thanks,
Ram