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: Thorsten Jolitz
Subject: Re: How to check whether a character (or one-character string) is a letter?
Date: Sat, 04 Oct 2014 03:38:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

Hello,

> this is a problem I have.
>
> 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?
>
> The reason I'm asking is that I'm writing a function which converts an
> arbitrary string to a valid (and nice) filename (e.g., only letters and
> hyphens) - so basically I want to walk a string character by character
> and convert any space to a hyphen and omit any other non-letter.  Am I
> reinventing the wheel?

there is something similar in PicoLisp:

#+BEGIN_SRC picolisp :results pp
 (fold "abc-?/@ä-12 YZ  #+ü")
#+END_SRC

#+results:
: "abcä12yzü"

but not quite ...


-- 
cheers,
Thorsten




reply via email to

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