🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #899

Re: WANTED: macro which extracts first char of its argument - possible?

#899
From: hank
Date: Thu, 06 Aug 1992 00:06
13 lines
1037 bytes
In article <1992Aug5.133331.9379@bernina.ethz.ch>, 
schaeppe@nessie.cs.id.ethz.ch (Christian Schaepper) writes:
> is it possible to write a macro which extracts the first character of
> its argument (such that, for example, `\firstchar{abc}' yields `a') ?

Here's a non-TeXnician's approach. Please do not show this to Barr or
Arseneau or Taylor or Rose or ...., it would be too embarrassing.

\def\firstchar#1{%
\def\FirstChar##1##2\EndFirstChar{##1}%
\expandafter\FirstChar#1\relax\EndFirstChar}

--darrel hankerson hank@ducvax.auburn.edu
Technical Details
Message-ID: <1992Aug5.190650.1@ducvax.auburn.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!news.duc.auburn.edu!ducvax.auburn.edu!hank
References: <1992Aug5.133331.9379@bernina.ethz.ch>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!news.duc.auburn.edu!ducvax.auburn.edu!hank
From: hank@ducvax.auburn.edu
Newsgroups: comp.text.tex
Subject: Re: WANTED: macro which extracts first char of its argument - possible?
Message-ID: <1992Aug5.190650.1@ducvax.auburn.edu>
Date: 6 Aug 92 00:06:50 GMT
References: <1992Aug5.133331.9379@bernina.ethz.ch>
Sender: usenet@news.duc.auburn.edu (News Account)
Organization: Auburn University, AL
Lines: 13
Nntp-Posting-Host: ducvax