[Tutor] numbers and ranges

Jon Crump jjcrump at myuw.net
Sun May 27 20:01:45 CEST 2007


Dear all,

Here's a puzzle that should be simple, but I'm so used to words that 
numbers tend to baffle me.

I've got fields that look something like this:
1942. Oct. 1,3,5,7,8,9,10

I need to parse them to obtain something like this:
<sometag start="1942-10-01"/>
<sometag start="1942-10-03"/>
<sometag start="1942-10-05"/>
<sometag start="1942-10-07" end "1942-10-10"/>

The xml representation is incidental, the basic problem is how to test a 
list of integers to see if they contain a range, and if they do, do 
something different with them.

I'm sure this is the question of a rank tyro, but the denizens of this 
list seem tolerant and gentle. Many thanks.


More information about the Tutor mailing list