| 1 |
% This file is embedded in datatool-user.pdf version 3.4.3 2025-12-04 |
| 2 |
% Example 26 Suffix Tests |
| 3 |
% Label: "ex:suffixif" |
| 4 |
% arara: pdflatex |
| 5 |
% arara: pdfcrop |
| 6 |
\documentclass[12pt]{article} |
| 7 |
\pagestyle{empty} |
| 8 |
\usepackage{datatool-base} |
| 9 |
\newcommand{\strA}{An apple} |
| 10 |
\newcommand{\strB}{n~apple} |
| 11 |
|
| 12 |
\begin{document} |
| 13 |
(First two arguments expanded) `\strB' |
| 14 |
\DTLifEndsWith{\strA}{\strB}{is suffix}{isn't suffix} |
| 15 |
of `\strA'. |
| 16 |
|
| 17 |
(Non-breakable space same as space) `n~apple' |
| 18 |
\DTLifEndsWith{An apple}{n~apple}{is suffix}{isn't suffix} |
| 19 |
of `An apple'. |
| 20 |
|
| 21 |
(Robust commands stripped) `apple' |
| 22 |
\DTLifEndsWith{An \MakeUppercase{a}pple}{apple}{is suffix}{isn't suffix} |
| 23 |
of `An \MakeUppercase{a}pple'. |
| 24 |
|
| 25 |
(Case-sensitive) `apple' |
| 26 |
\DTLifEndsWith{An Apple}{apple}{is suffix}{isn't suffix} |
| 27 |
of `An Apple'. |
| 28 |
|
| 29 |
(Ignore case) `apple' |
| 30 |
\DTLifEndsWith*{An Apple}{apple}{is suffix}{isn't suffix} |
| 31 |
of `An Apple'. |
| 32 |
|
| 33 |
(Leading space) ` apple' |
| 34 |
\DTLifEndsWith{an apple}{ apple}{is suffix}{isn't suffix} |
| 35 |
of `an apple'. |
| 36 |
|
| 37 |
(Leading space) ` apple' |
| 38 |
\DTLifEndsWith{anapple}{ apple}{is suffix}{isn't suffix} |
| 39 |
of `anapple'. |
| 40 |
\end{document} |