Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How do i find index of current list item and remove

Using C# in unity, I have a string list that on a button click will randomly generate a string item from the list. I would like to transfer each item to a used list once it has been shown to keep from having repeats. I have only been able to find info on how to remove the item from a list if you know the index value. How do I go about finding the index value of the string that is currently being displayed and then transfer that index value to a separate list while removing it from the current list. for example:


I have a list of questions --> user clicks a button and in a text box a random question is pulled from the question list --> user clicks a button to go to the next question --> on the button click find the index value of the question that was just displayed from the questions list --> send the string value from that index number to a usedQuestions list and remove that specific string value from the Questions list.

Thanks in advance

Sign In or Register to comment.