% This file is embedded in datatool-user.pdf version 3.4.1 2025-04-25
% Example 51 CSV List Argument Expansion
% Label: "ex:incsvlist"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage{datatool-base}
\newcommand{\mylist}{ant,duck,goose,zebra} 
\begin{document}
`duck' in `ant,duck,goose,zebra'?
\DTLifinlist{duck}{ant,duck,goose,zebra}{true}{false}. 

`duck' in `\mylist' (single token)?
\DTLifinlist{duck}{\mylist}{true}{false}. 

`duck' in ` \mylist' (one element, two tokens)? \DTLifinlist{duck}{ \mylist}{true}{false} 

`duck' in `\mylist,zebu' (two elements)? \DTLifinlist{duck}{\mylist,zebu}{true}{false}. 
\end{document}
