You need to sign in to do that
Don't have an account?
how to remove a value from list without using its index
hi
i have a list like-- "list<string>options=new list<string>{'a','b','c','d','e','f','g','h'};"
from this list i want to remove "e" (lets assume that 'i have dont know its index')
just add all list values to a SET.
we can directly remove values from set using remove() method.
after that add this set to a perticuler list.
All Answers
Hi,
To this you can use APEX coding, For this
1) Declare new List of same type.
2) Loop through the List elements and if the element matches with your target element (In your case” e”) then don’t add that element to your list, otherwise add elements to that new list.
3) Now new list will be formed with your required values.
4) Use new list or Assign new list to the old list (as you required).
iterate to your list and call the .remove
just add all list values to a SET.
we can directly remove values from set using remove() method.
after that add this set to a perticuler list.