How can i retrieve a list of items (string) which contain a specific word from another list. Here is an Example :
(setq l '("word1_jj" "word2_mm" "word3_jj" "word4_kk"))
I wanna extract all string in which figure "_jj.
How can i retrieve a list of items (string) which contain a specific word from another list. Here is an Example :
(setq l '("word1_jj" "word2_mm" "word3_jj" "word4_kk"))
I wanna extract all string in which figure "_jj.
Copyright © 2021 Jogjafile Inc.
You should make
ends-with-p
that takes the word and an ending. To do that you find out how many characters there is in the two strings and usesubseq
to make a string consisting of the last letters of the word. You can useequal
to check it with the supplied argument it should match.When you have that you can do this:
Alternatively you could make a
make-end-predicate
that returns alambda
that takes a word: