% This file is embedded in datatool-user.pdf version 3.4 2025-04-03
% Example 26 Suffix Tests
% Label: "ex:suffixif"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage{datatool-base}
\newcommand{\strA}{An apple}
\newcommand{\strB}{n~apple}

\begin{document}
(First two arguments expanded) `\strB'
\DTLifEndsWith{\strA}{\strB}{is suffix}{isn't suffix}
of `\strA'. 

(Non-breakable space same as space) `n~apple'
\DTLifEndsWith{An apple}{n~apple}{is suffix}{isn't suffix}
of `An apple'. 

(Robust commands stripped) `apple'
\DTLifEndsWith{An \MakeUppercase{a}pple}{apple}{is suffix}{isn't suffix}
of `An \MakeUppercase{a}pple'. 

(Case-sensitive) `apple'
\DTLifEndsWith{An Apple}{apple}{is suffix}{isn't suffix}
of `An Apple'. 

(Ignore case) `apple'
\DTLifEndsWith*{An Apple}{apple}{is suffix}{isn't suffix}
of `An Apple'. 

(Leading space) ` apple'
\DTLifEndsWith{an apple}{ apple}{is suffix}{isn't suffix}
of `an apple'. 

(Leading space) ` apple'
\DTLifEndsWith{anapple}{ apple}{is suffix}{isn't suffix}
of `anapple'. 
\end{document}