[texhax] detect characters in strings

Philip Taylor (Webmaster, Ret'd) P.Taylor at Rhul.Ac.Uk
Wed Jul 7 20:14:37 CEST 2010


Maybe try \edef ?
Philip Taylor
--------
Brandon Kuczenski wrote:

> I'd like to use \BeforeSubString and \BehindSubString,
> except I can't figure out how to use them:
>
> \BeforeSubString{substring}{string} "Returns" the part of <string> that
> is before <substring>-- how does it "return" anything? The following
> doesn't work:
>
> \def\SciToFP#1#2{%
> \typeout#2
> \def\mantissa{\BeforeSubString{e}{#2}}
> \typeout\mantissa
> % ... do something with mantissa and FP
> }
>
> it fails with the error:
> ! Undefined control sequence.
> \su at BeforeSubString #1#2->\def \su at rest
> ##1#1##2\@nil {##1}\IfSubStringInStr...
>
> I tried with \let too and that didn't work:
>
> \let\mantissa=\BeforeSubString{e}{#2}
>
> gives me
> ! Argument of \mantissa has an extra }.
> <inserted text>
> \par


More information about the texhax mailing list