How can I test a string to see if it has more than one paragraph, and split a string that contains multiple paragraphs into two strings, one with the first paragraph of the original, one with the remainder.
Background: xstring
fails when presented with a long (in the \long\def sense) string. I am writing a routine which takes quotations and formats them with a lettrine and some user-specified amount of emphasized (typically small-cap) text at the beginning. This works fine for single-paragraph input, but fails for multi-. In all multi-paragraph quotations, the styling needs to be done only in the first paragraph, hence the CAR/CDR request (and that can be iterated to handle long strings with more than two paragraphs).
I am happy to share my working code with anyone who is interested.
MWE:
\documentclass{minimal}
\usepackage{xstring}
\begin{document}
\newcommand*{\InputOne}{abc\endgraf def}\InputOne
---
\newcommand{\InputTwo}{ghi\par jkl}\InputTwo
---
\StrLeft{\InputOne}{2}
---
\StrLeft{\InputTwo}{2}
---
\StrLeft{mno
pqr}{2}
\end{document}
\long\def\dosomethingwithalongtext #1\par #2\blahblah{...}
and feed it with your string terminated by\par\blahblah
. It might check for emptiness of the second argument then.