[texhax] The last character of a string

Donald Arseneau asnd at triumf.ca
Fri Jan 29 20:25:25 CET 2010


Michael Barr <barr at math.mcgill.ca> writes:

> Is there a simple way to find the last character of a string?  

You have to scan through the tokens from first to last.

> What I want to do is add a period unless the string already 
> ends in a period, question mark, or exclamation mark, 

Oh that's easy -- check the value of \spacefactor.
Easy, but not 100% reliable.


-- 
Donald Arseneau                          asnd at triumf.ca


More information about the texhax mailing list