% This file is embedded in datatool-user.pdf version 3.4.5 2026-08-23
% 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}
