Erlang lists:index_of function?

后端 未结 6 1959
臣服心动
臣服心动 2020-12-10 01:58

I\'m looking for an Erlang library function that will return the index of a particular element in a list.

So, if

<         


        
6条回答
  •  执笔经年
    2020-12-10 02:40

    As others noted, there are more efficient ways to solve for this. But if you're looking for something quick, this worked for me:

    string:str(List, [Element]).
    

提交回复
热议问题