Jesteś w: Start / Przedsięwzięcia/Projects / TeX Pearls / 2005 Pearls / david-kastrup / bachotex2005-david-kastrup-pearl1.tex

bachotex2005-david-kastrup-pearl1.tex

TeX document icon bachotex2005-david-kastrup-pearl1.tex — TeX document, 1 KB

Zawartość pliku

%%% David Kastrup: Comparing strings known to consist only of characters

\def\strequal#1{\number\strequalstart{}{}#1\relax}
\def\strequalstart#1#2#3{\if#3\relax\strequalstop\fi
  \strequalstart{\if#3#1}{#2\fi}}
\def\strequalstop\fi\strequalstart#1#2#3{\fi#1#3\relax'#213 }

% example

\if\strequal{junk}{junk}yes\else no\fi,
\if\strequal{junk}{Junk}yes\else no\fi.