Having string let's say 01c23a45b6, what is the most idiomatic way to find the position of either 'a', 'b' or 'c' char in that string?
Hi and thanks.
And how to go about finding one of let's say few, that is I would like to find first of (a,b or c)?
Please read the documentation for
str::find(). It explicitly states that:
So, you can use
['a', 'b', 'c'].as_slice() in the argument.
I think as slice is being called on unstable fixed_size_array?
You can use
&['a', 'b', 'c'][..] as well, it doesn't matter.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.