[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: build-in function for obtaining the index of an element of a list
From: |
Juanma Barranquero |
Subject: |
Re: build-in function for obtaining the index of an element of a list |
Date: |
Wed, 4 Jan 2012 13:51:25 +0100 |
> Is there any Emacs built-in function that returns the index of an element of
> a list?
If you don't mind using the CL package (included with Emacs), the
function you want is `position'
(position "banana" '("apple" "banana" "orange") :test 'string=) => 1
Juanma