| 1 |
% This file is embedded in datatool-user.pdf version 3.4.3 2025-12-04 |
| 2 |
% Example 36 Substring Conditionals for use with ifthen |
| 3 |
% Label: "ex:DTLissubstr" |
| 4 |
% arara: pdflatex |
| 5 |
% arara: pdfcrop |
| 6 |
\documentclass[12pt]{article} |
| 7 |
\pagestyle{empty} |
| 8 |
\usepackage{datatool-base} |
| 9 |
\begin{document} |
| 10 |
`goose' element of list `ant,duck,goose'? |
| 11 |
\ifthenelse{\DTLisinlist{goose}{ant,duck,goose}}{true}{false}. |
| 12 |
|
| 13 |
`oo' element of list `ant,duck,goose'? |
| 14 |
\ifthenelse{\DTLisinlist{oo}{ant,duck,goose}}{true}{false}. |
| 15 |
|
| 16 |
`oo' in `goose'? |
| 17 |
\ifthenelse{\DTLisSubString{goose}{oo}}{true}{false}. |
| 18 |
|
| 19 |
`oo' in `GOOSE' (case-sensitive)? |
| 20 |
\ifthenelse{\DTLisSubString{GOOSE}{oo}}{true}{false}. |
| 21 |
|
| 22 |
`oo' in `GOOSE' (ignore case)? |
| 23 |
\ifthenelse{\DTLisiSubString{GOOSE}{oo}}{true}{false}. |
| 24 |
|
| 25 |
`go' prefix of `goose'? |
| 26 |
\ifthenelse{\DTLisPrefix{goose}{go}}{true}{false}. |
| 27 |
|
| 28 |
`go' prefix of `GOOSE' (case-sensitive)? |
| 29 |
\ifthenelse{\DTLisPrefix{GOOSE}{go}}{true}{false}. |
| 30 |
|
| 31 |
`go' prefix of `GOOSE' (ignore case)? |
| 32 |
\ifthenelse{\DTLisiPrefix{GOOSE}{go}}{true}{false}. |
| 33 |
|
| 34 |
`se' suffix of `goose'? |
| 35 |
\ifthenelse{\DTLisSuffix{goose}{se}}{true}{false}. |
| 36 |
|
| 37 |
`se' suffix of `GOOSE' (case-sensitive)? |
| 38 |
\ifthenelse{\DTLisSuffix{GOOSE}{se}}{true}{false}. |
| 39 |
|
| 40 |
`se' suffix of `GOOSE' (ignore case)? |
| 41 |
\ifthenelse{\DTLisiSuffix{GOOSE}{se}}{true}{false}. |
| 42 |
\end{document} |