[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Groff] String editing?
From: |
Ted Harding |
Subject: |
RE: [Groff] String editing? |
Date: |
Thu, 10 Feb 2000 23:09:27 -0000 (GMT) |
On 10-Feb-00 Eddie Maddox wrote:
> How is string editing done? The Groff manual, ed. 1.12, Oct'99,
> is lacking that info, I think.
>
> Ex:
> .<align or .<href or .<alt, etc.
> then:
> \\$0 == "<align" or "<href" or "<alt", etc.
> so: how do I strip the "<" so I can use just the "align" later on?
You don't -- at any rate not in groff. There are no string-editing
functions in groff.
Indeed it is one of the things that it would be very useful to have.
One could start with a function which "explodes" a string into
its component characters. Then these could become separate arguments
to an arbitrary macro, which should enable most string-editing
requirements to be met (admittedly in a rather brutish way).
A long-standing need which could be met by this is a "small-capitals"
facility, whereby
This is Small Caps --> T\s-2HIS\s0 \s-2IS\s0 S\s-2MALL\s0 C\s-2APS\s0
(or similar). I've had this in mind as a hack to try for some time.
Maybe soon ...
Meanwhile, string-editing could be farmed out to an external
program such as sed or awk which is built for the job (using
a similar mechanism to the way psbb was used).
I hope this helps ...
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 10-Feb-00 Time: 23:09:27
------------------------------ XFMail ------------------------------