all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* a function for string splitting
@ 2002-11-26 14:16 Luis O. Silva
  2002-11-26 20:03 ` Greg Hill
  0 siblings, 1 reply; 13+ messages in thread
From: Luis O. Silva @ 2002-11-26 14:16 UTC (permalink / raw)


Dear Emacs community,

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)"

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.

Please be indulgent with me since

1. I'm not a programmer
2. I don't have access to the elisp manual even on-line (my
connection is very slow, only sufficient to download my
e-mail).

Thank you very much in advance
luis



-- 
Luis Octavio Silva P.
St. Petersburg State University.
66/3 Botanicheskaya St., Apt.119/2
Stary Peterhof
St. Petersburg, Russia.

^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <mailman.1038319044.17125.help-gnu-emacs@gnu.org>]
* Re: a function for string splitting
@ 2002-11-26 20:14 Greg Hill
  2002-11-27  5:40 ` Luis O. Silva
  0 siblings, 1 reply; 13+ messages in thread
From: Greg Hill @ 2002-11-26 20:14 UTC (permalink / raw)


Luis,
Oops, too many "(".  Make that:

(let*
  (split-date (split-string "Thu, 21 Nov 2002 16:05:50 -0600 (CST)" " "))
  (day-of-week (elt split-date 0))
  (day-of-month (elt split-date 1))
  (month (elt split-date 2))
  ...)

--Greg

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-11-29  7:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-26 14:16 a function for string splitting Luis O. Silva
2002-11-26 20:03 ` Greg Hill
     [not found] <mailman.1038319044.17125.help-gnu-emacs@gnu.org>
2002-11-26 14:49 ` Lee Sau Dan
2002-11-26 19:59   ` Luis O. Silva
2002-11-26 15:56 ` Daniel Jensen
2002-11-26 20:25   ` Luis O. Silva
     [not found]   ` <mailman.1038341287.29557.help-gnu-emacs@gnu.org>
2002-11-28 14:14     ` Kai Großjohann
2002-11-28 18:21       ` Luis O. Silva
     [not found]       ` <mailman.1038506557.25888.help-gnu-emacs@gnu.org>
2002-11-28 18:30         ` Benjamin Lewis
2002-11-28 18:50         ` Kai Großjohann
2002-11-29  7:03           ` Luis O. Silva
  -- strict thread matches above, loose matches on Subject: below --
2002-11-26 20:14 Greg Hill
2002-11-27  5:40 ` Luis O. Silva

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.