diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/substr/testsubstr.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/substr/testsubstr.tex | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/substr/testsubstr.tex b/Master/texmf-dist/doc/latex/substr/testsubstr.tex new file mode 100644 index 00000000000..2b9054ae045 --- /dev/null +++ b/Master/texmf-dist/doc/latex/substr/testsubstr.tex @@ -0,0 +1,50 @@ +\documentclass{minimal} +\usepackage{substr} +\def\str{hellohello} +\def\longstr{hellohellohellohello} +\def\medstr{hellohellohello} +\def\substr{ell} +\def\subSTR{ELL} + +\newcounter{appearances} +\begin{document} + +\bigskip{\bfseries IfSubStringInString} + +\IfSubStringInString{\substr}{\str}{``\subSTR'' is in ``\str''}{Error} + +\IfSubStringInString{\subSTR}{\str}{Error}{No ``\subSTR'' in ``\str''} + + +\bigskip{\bfseries BeforeSubString and BehindSubString} + +Text befor ``\substr'' in ``\str'': +\BeforeSubString{\substr}{\str} + +Text after ``\substr'' in ``\str'': +\BehindSubString{\substr}{\str} + +\BeforeSubString{\substr}{\str}% +\emph{\bfseries\substr}% +\BehindSubString{\substr}{\str} + + +\bigskip{\bfseries CountSubStrings} + +Count of ``\substr'' in ``\str'': +\CountSubStrings{\substr}{\str} + +Count of ``\substr'' in ``\medstr'': +\CountSubStrings{\substr}{\medstr} + +Count of ``\substr'' in ``\longstr'': +\CountSubStrings{\substr}{\longstr} + + +\bigskip{\bfseries SubStringsToCounter} + +\SubStringsToCounter{appearances}{\substr}{\str}% +Count of ``\substr'' in \str'' (counter): +\theappearances + +\end{document} |