.IndexOf Error--Must have StringComparison
Hi Everyone (newbie here!)-- I am trying to create an auto-complete search input field in unity and I have done a lot of research and found a code that links an input field to a dropdown menu and then when the user searches, the items from the drop down menu auto-populate.
However, I'm having some trouble with this section of the code:
public void FilterDropdown(string input)
{
dropdown.options = dropdownOptions.FindAll(option => option.text.IndexOf(input) >= 0);
}
}
I'm getting an error under the "option.text.IndexOf(input)" portion of the function, telling me that IndexOf needs a StringComparison.
I have tried a few things like .IndexOf(input, System.StringComparison.Ordinal) but still no luck.
Anyone got any ideas?
Thanks!
Your answer
Follow this Question
Related Questions
Problems with respawning using a very simple script 1 Answer
The lifespan of an object instance in a Monobehavior script 0 Answers
How to display random questions without repeating the previous? 2 Answers
Change Audio Mixer through script for every scene 0 Answers
Why Does this not work? please someone help me i am new to coding. 1 Answer