% This file is embedded in datatool-user.pdf version 3.4.4 2026-07-31
% Example 19 Testing if an Element is in a Comma-Separated List
% Label: "ex:DTLifinlist"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
 \usepackage{datatool-base}
\newcommand{\goose}{goose}
\newcommand{\mylist}{duck,\goose,{ant},zebra} 
\begin{document}
 `ant' in list? \DTLifinlist{ant}{\mylist}{true}{false}. 

`goose' in list? \DTLifinlist{goose}{\mylist}{true}{false}. 

`\goose' in list? \DTLifinlist{\goose}{\mylist}{true}{false}. 

`duck' in list? \DTLifinlist{duck}{\mylist}{true}{false}. 

`zebra' in list? \DTLifinlist{zebra}{\mylist}{true}{false}. 
\end{document}
