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

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

Re: a function for string splitting


From: Daniel Jensen
Subject: Re: a function for string splitting
Date: Tue, 26 Nov 2002 16:56:36 +0100
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i686-pc-linux-gnu)

"Luis O. Silva" <silva@paloma.spbu.ru> writes:

> I'm writing a function for translating dates in the form of a
> string into Spanish and Russian. For example, you have:
>
> "Thu, 21 Nov 2002 16:05:50 -0600 (CST)"

You might want to use format-time-string instead. To get the above
date form but with localized month and day names, you would use:

(format-time-string "%a, %e %b %Y %H:%M:%S %z (%Z)")

> Within my function I used a `let' expression of the form:
>
> (let ((day (substring "Thu, 21 Nov 2002 16:05:50 -0600 (CST)" 0 3))
>        (month (substring "Thu, 21 Nov 2002 16:05:50 -0600 (CST)" 8 11)))
>        ...)
>
> All works fine provided that there isn't any date with
> one-digit day, i. e., "Fri, 8 Nov 2002 11:56:37 -0500 (CST)"
>
> My question is what function I could use for correctly
> splitting the string.

There is actually a split-string function.

-- 
Daniel Jensen
> (format (concat "mailto:"; "%s@%s.%s") "daniel" "bigwalter" "net")


reply via email to

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