help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to check whether a character (or one-character string) is a lett


From: Eli Zaretskii
Subject: Re: How to check whether a character (or one-character string) is a letter?
Date: Sat, 04 Oct 2014 10:29:38 +0300

> From: Marcin Borkowski <mbork@wmi.amu.edu.pl>
> Date: Sat, 04 Oct 2014 02:29:24 +0200
> 
> Assume that I have a character (taken from some string, which in turn is
> copied from the buffer - so it need not be ASCII).  What is the best way
> to check whether it is a letter within ASCII range?

One way is this:

  (= 1 (string-bytes (char-to-string ch)))

where 'ch' is the character you want to test.  Note that this will
pass any 7-bit ASCII character, including control characters, digits,
and punctuation, not just "letters".




reply via email to

[Prev in Thread] Current Thread [Next in Thread]